I have a ListView that has a solid color selector set only.
<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>
assign_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>
In ListView.Adapter for my list, I have items that have their background image background set to a specific color. My question is why does the selector not work at all when displaying the selected color for my list? If so, then any suggestion for use allows me to set the background color of the view.
Bryan source share