Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8984987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:14:15+00:00 2026-06-15T21:14:15+00:00

I have a listView with several element and section header. All item have a

  • 0

I have a listView with several element and section header.
All item have a section header but display this only if neccessary. here the xml code of may item :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_selector_transparent"
android:paddingLeft="@dimen/padding_small"
android:paddingRight="@dimen/padding_small" >

<TextView
    android:id="@+id/item_training_section_header"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_marginTop="@dimen/item_training_section_header_margin_top"
    android:background="@drawable/list_selector_transparent"
    android:paddingLeft="@dimen/padding_small"
    android:textColor="@color/item_training_section_header_color"
    android:textSize="@dimen/item_training_section_header_text_size"
    android:textStyle="bold"
    android:visibility="visible" />

<RelativeLayout
    android:id="@+id/item_training_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@id/item_training_section_header"
    android:background="@drawable/list_selector"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/item_training_logo"
        android:layout_width="@dimen/item_training_image_width"
        android:layout_height="@dimen/item_training_image_height"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_margin="@dimen/margin_small"
        android:contentDescription="@string/image_description" />

    <TextView
        android:id="@+id/item_training_title_formation"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_margin="@dimen/margin_small"
        android:layout_toRightOf="@id/item_training_logo"
        android:textColor="@color/item_training_title_formation_color"
        android:textSize="@dimen/item_training_title_formation_text_size" />
</RelativeLayout>

I try several thing with “android:clickable” and “android:descendantFocusability” but nothing work. Do you have any idea ?
Thank for yours responses ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:14:16+00:00Added an answer on June 15, 2026 at 9:14 pm

    So, I found the solution. It was very simply but I don’t sure to understand why :

    I just insert the clickable parameter at true my section header :

    android:clickable="true"
    

    Here the all item :

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/padding_small"
    android:paddingRight="@dimen/padding_small" >
    
    <TextView
        android:id="@+id/item_training_section_header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:clickable="true"
        android:layout_marginTop="@dimen/item_training_section_header_margin_top"
        android:paddingLeft="@dimen/padding_small"
        android:textColor="@color/item_training_section_header_color"
        android:textSize="@dimen/item_training_section_header_text_size"
        android:textStyle="bold"
        android:visibility="visible" />
    
    <RelativeLayout
        android:id="@+id/item_training_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/item_training_section_header"
        android:background="@drawable/list_selector"
        android:orientation="horizontal" >
    
        <ImageView
            android:id="@+id/item_training_logo"
            android:layout_width="@dimen/item_training_image_width"
            android:layout_height="@dimen/item_training_image_height"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:layout_margin="@dimen/margin_small"
            android:contentDescription="@string/image_description" />
    
        <TextView
            android:id="@+id/item_training_title_formation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_margin="@dimen/margin_small"
            android:layout_toRightOf="@id/item_training_logo"
            android:textColor="@color/item_training_title_formation_color"
            android:textSize="@dimen/item_training_title_formation_text_size" />
    </RelativeLayout>
    

    Anybody can explain this solution ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ListView that uses a GridView to display several columns of data. Two
Background: I have a ListView / GridView with several columns. In some situations, only
My question is often asked at several places, but I have an xml, without
This question may have been answered on SO several times but it didn't cover
I have a listview with several columns. I want to change the column header
I got several questions on SO on this topic but all those are related
I have a listview with several items that are created dynamically, each has two
I have a listview that contain several EditTexts created dynamically according to the number
I have a ListView template that's being used in several places and I'd like
I have several similar user controls which display listviews of respectively different data entities.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.