私はListView
単色のセレクターセットを持つ を持っています。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/assignmentSelectedItem" />
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/assignmentsListView"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:listSelector="@drawable/assignment_list_selector" />
</LinearLayout>
Assignment_list_selector.xml -
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@android:color/white" />
<item android:drawable="@android:color/transparent"/>
</selector>
ListView.Adapter
私のリストには、ビューの背景が特定の色に設定されている項目があります。私の質問は、リストビューで選択した色を表示する際にセレクターがまったく機能しないのはなぜですか? もしそうなら、ビューの背景色を設定できるようにする回避策の提案。