Android : selectors for custom listviews -


<?xml version="1.0" encoding="utf-8"?>  <selector xmlns:android="http://schemas.android.com/apk/res/android">   <item android:state_focused="true" android:drawable="@drawable/layout_bg1" /> <!-- focused -->   <item android:state_pressed="true" android:drawable="@drawable/layout_bg1" /> <!-- pressed -->   <item android:drawable="@drawable/layout_bg" /> <!-- default --> </selector>  

i trying use custom drawables in list selector.here error message getting in first line:

the processing instruction target matching "[xx][mm][ll]" not allowed.

you try codes dependable need . such as

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">      <item android:drawable="@color/footer_color" android:state_pressed="true"/>     <item android:drawable="@color/footer_color" android:state_selected="true"/>     <item android:drawable="@android:color/transparent"/>     <item android:drawable="@drawable/back_black" android:state_pressed="true"/>      <item android:drawable="@layout/full_image_screen" android:state_pressed="true"/>  </selector>  

must remember when access @drawable must include drawable image layout.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -