Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the border in a Listview?

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

like image 772
Hardik Gajjar Avatar asked Mar 24 '11 04:03

Hardik Gajjar


4 Answers

do this

myListview.setDivider(null);

This should help you.

like image 70
Rohit Mandiwal Avatar answered Nov 18 '22 20:11

Rohit Mandiwal


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"
/>
like image 42
Daniel Avatar answered Nov 18 '22 18:11

Daniel


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"
like image 20
duggu Avatar answered Nov 18 '22 18:11

duggu


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"
like image 6
sivi Avatar answered Nov 18 '22 19:11

sivi