Is it possible to apply a custom background to each Listview item via the list selector?
The default selector specifies @android:color/transparent
for t
I've been frustrated by this myself and finally solved it. As Romain Guy hinted to, there's another state, "android:state_selected"
, that you must use. Use a state drawable for the background of your list item, and use a different state drawable for listSelector
of your list:
list_row_layout.xml:
...
listitem_background.xml:
layout.xml that includes the ListView:
...
...
listitem_selector.xml: