Hi, i have a listview with a custom item_row.xml. I've defined a selector in this way:
<?xml version="1.0" encoding="utf-8"?>
<item
android:state_pressed="false"
android:drawable="@drawable/list_bg" >
</item>
<item
android:state_pressed="true"
android:drawable="@drawable/header_bg" >
</item>
<item
android:state_focused="false"
android:drawable="@drawable/list_bg" >
</item>
<item
android:state_focused="true"
android:drawable="@drawable/header_bg">
</item>
and then put into item_row.xml in this way:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="70dip"
android:orientation="vertical"
android:background="@drawable/list_selector">
I want 2 things:
- When i move with arrow keys, the item selected changed its background. It's works fine with the actual implementation of selector.
- When i press a item, the item changed its background too, but it doesn't work with the actual selector.
Any idea? I try to set also into the ListView android:listSelector="@drawable/list_selector" but it doesn't work neither.
Thanks