1
I have a layout and in it I want to display the data in this ListView but I need it to have a white background with no stripes and no click enabled when it’s touched. I can do it this way??
1
I have a layout and in it I want to display the data in this ListView but I need it to have a white background with no stripes and no click enabled when it’s touched. I can do it this way??
3
To remove the "stripe" from your ListView just you set the divider as @null. See below:
<ListView
android:id="@+id/list"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null"
android:dividerHeight="0dp"/>
And so it has no effect at the time of click, just you set the listSelector as transparent.
<ListView
android:id="@+id/list"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="@android:color/transparent"/>
Browser other questions tagged java android listview
You are not signed in. Login or sign up in order to post.
WOW! Tomorrow I’ll be at work and I’ll tell you if I’ve had =D
– Aline
It worked. But why you put the android:dividerHeight="0dp"?
– Aline
@Aline so that the
divideris not tall. Therefore, there is no room left for thedivider(that line)– viana
@Aline maybe on some devices, set only the Divider as
@nullwill not work, so putandroid:dividerHeight="0dp", which is guaranteed to work on any device and any version of Android– viana