`목록 선택기를 사용하고 있지만 작동하지 않습니다. 목록 항목을 클릭 한 후에 효과가 나타 났지만 항목을 클릭하기 전에는 효과가 없습니다.Android ListView 선택기가 제대로 작동하지 않습니다.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="false"
android:state_pressed="false"
android:drawable="@drawable/ic_launcher" />
<item android:state_pressed="true"
android:drawable="@drawable/headerplain" />
<item
android:state_focused="true"
android:state_pressed="false"
android:drawable="@drawable/headerplain" />
<item android:state_selected="true"
android:state_pressed="false"
android:drawable="@drawable/headerplain" />
</selector>
and I have applied it to listView as
<ListView
android:id="@+id/listView123"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:listSelector="@drawable/list_selector"
android:drawSelectorOnTop="true"
android:focusable="true"
>
</ListView>
사전에이 문제에서