46

On Android, how can the Line which appears in a listview at the bottom of Lists be removed?

Michael Gaskill
  • 7,913
  • 10
  • 38
  • 43
Hardik Gajjar
  • 5,038
  • 8
  • 33
  • 51

5 Answers5

86

do this

myListview.setDivider(null);

This should help you.

Moak
  • 12,596
  • 27
  • 111
  • 166
Rohit Mandiwal
  • 10,258
  • 5
  • 70
  • 83
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
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"
Community
  • 1
  • 1
duggu
  • 37,851
  • 12
  • 116
  • 113
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