On Android, how can the Line which appears in a listview
at the bottom of Lists be removed?
Asked
Active
Viewed 3.9k times
46

Michael Gaskill
- 7,913
- 10
- 38
- 43

Hardik Gajjar
- 5,038
- 8
- 33
- 51
5 Answers
86
do this
myListview.setDivider(null);
This should help you.

Moak
- 12,596
- 27
- 111
- 166

Rohit Mandiwal
- 10,258
- 5
- 70
- 83
-
If you are inside an activity that extends ListActivity (custom adapter), it would be getListView().setDivider(null); – Rommel Paras Feb 11 '15 at 19:33
-
@rohitmandiwal can you help answer this question please? http://stackoverflow.com/questions/37358015/android-listview-inside-cardview-ontouch-listener-conflict-sensitivity – sudoExclaimationExclaimation May 21 '16 at 20:08
56
Another option would be to set a transparent color for the android:divider attribute:
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="#00000000"
/>

Daniel
- 2,642
- 1
- 26
- 28
-
I like this better; configuring things like dividers should be less obtrusive. – Kevin D. Feb 16 '15 at 08:48
20
see this link to more info:-
getListView().setDivider(null);
getListView().setDividerHeight(0);
Or, if you want to do it in XML:
android:divider="@null"
android:dividerHeight="0dp"
6
Great answers. I decided to use this in ListView for better readability than colour "#00xxxxxx". transparent is a system colour available by android platform.
android:divider="@android:color/transparent"

sivi
- 10,654
- 2
- 52
- 51
2
Please write this one after defining your listview:
Yourlistview.setDivider(null); // Will remove the divider

Darussian
- 1,573
- 1
- 16
- 28

Denny Sharma
- 3,015
- 1
- 13
- 14