Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android gallery item selector

I want to use following selector drawable for android gallery image will it work ?

<selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item state_selected="true" android:drawable="@drawable/selected_icon" >
     </item>

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

</selector>

i tried but it is not working

like image 506
d-man Avatar asked Aug 19 '26 07:08

d-man


1 Answers

i am able to fix it by myself.

The same xml file worked as shows above only difference is as under

make sure selected and unselected images having same height and width else it will not work.

like image 120
d-man Avatar answered Aug 20 '26 22:08

d-man



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!