listview - List selector state selected not working [ANDROID] -


in app, using list view show list of items have 1 text , 1 image, have added list selector attribute list view list item clicked background color changed different one.the problem when list item selected listview's row (that text view , image view) background not changed state pressed working fine.how work? appreciated

listview

<listview android:id="@+id/list" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:choicemode="singlechoice" android:divider="@null" android:dividerheight="0dp" android:listselector="@drawable/nav_lists_selector" /> 

list selector

 <?xml version="1.0" encoding="utf-8"?>    <selector xmlns:android="http://schemas.android.com/apk/res/android"   android:exitfadeduration="@android:integer/config_mediumanimtime">     <item android:drawable="@drawable/list_pressed" android:state_pressed="true"/>     <item android:drawable="@drawable/list_selected" android:state_selected="true" /> </selector> 

list pressed

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">     <solid android:color="@color/clr_list_pressed"/> </shape> 

list selected

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">     <solid android:color="@color/clr_list_selected"/> </shape> 

you need add "normal status" in list selector

<item android:drawable="@drawable/normal_list_color_or_image" /> 

you added status selected , pressed, don't added normal status.

"normal status" when component don't have received 1 action.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -