Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android:headerDividersEnabled isn't working

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?

like image 344
Maximus Avatar asked Nov 05 '12 15:11

Maximus


1 Answers

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.

like image 182
PravinCG Avatar answered Sep 28 '22 18:09

PravinCG