android:headerDividersEnabled isn't working
Asked Answered
U

1

5

I want to have a divider at the top of a ListView (which is placed in RelativeLayout), but when I try to use this, I get only the bottom divider:

<ListView
        android:id="@+id/last_contacts_picked_list"
        android:headerDividersEnabled="true"
        android:footerDividersEnabled="true"
        android:paddingTop="50dp"
        android:dividerHeight="5dp"
        android:layout_marginTop="50dp"
        android:divider="@android:drawable/divider_horizontal_textfield"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="..."
        android:layout_alignLeft="..."
        android:layout_alignRight="..."
        android:layout_below="..."
         />

I've got something like this:

http://i051.radikal.ru/1211/4f/a408db5e717f.png

Why doesn't it have the header divider too?

Ulysses answered 5/11, 2012 at 15:56 Comment(1)
post the code for adding the headersLegalism
D
12

That is not what android:headerDividersEnabled is supposed to do. It means that if you are adding a list header whether that header needs to be separated by a divider or not.

For your problem simply use a linearlayout with ImageView having the divider as source followed by ListView. Hope this helps.

Debbradebby answered 5/11, 2012 at 16:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.