Show divider after the last item in the list
Asked Answered
C

2

4

I added a divider drawable to my listview but it appears for all the items except after the last item.

I only have 5 items on the list, so its all white space after the last item, i want to have a divider even after the last item

i tried this:

android:footerDividersEnabled="true"

in my listview. But it didnt work

Thank You

Copperplate answered 3/8, 2012 at 13:25 Comment(0)
T
11

Try following in XML

<View
    android:background="#00ff00"
    android:layout_width="fill_parent"
    android:layout_height="3dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/YOUR_LIST_ID" />
Tocantins answered 3/8, 2012 at 13:29 Comment(1)
It's Not a Correct Way @Chintan RaghwaniDodge
A
8

Horizontal line

<View
android:id="@+id/view"
android:background="#FF4500"
android:layout_width="fill_parent"
android:layout_height="2dp"     
android:layout_below="@+id/listview_id" />

vertical line

 <View
android:id="@+id/view"
android:background="#FF4500"
android:layout_width="2dp"
android:layout_height="fill_parent"     />
Anion answered 3/8, 2012 at 13:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.