i got the following problem.
i have a ListView with custom rows consisting of an imageview and a textview. the textview\'s xml code is
This is how it should look using selector:
Create a file within drawable called selector_listview_item.xml
, which looks like (change the colors to your own):
Now in your layout which describes the list row (e.g. layout_list_row.xml), On the root layout add the android:background="@drawable/selector_listview_item"
, So the layout would look something like:
android:orientation="vertical">
(Note: you might want to add android:focusable="false"
on you items within that listview row, to make the row clickable, as mentioned here)
Done.