标签:
如果是textview的textcolor属性设置成selecter,则需要这么写这个selecter:
<span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/navigation_menu_text_normal" android:state_focused="false" android:state_pressed="false" /> <item android:color="@color/navigation_menu_text_pressed" android:state_pressed="true" /> <item android:color="@color/navigation_menu_text_pressed" android:state_focused="true" /> </selector></span>
如果是background属性,则需要这么写这个selecter:
<span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@mipmap/arrow_menu_normal" android:state_focused="false" android:state_pressed="false" /> <item android:drawable="@mipmap/arrow_menu_pressed" android:state_pressed="true" /> <item android:drawable="@mipmap/arrow_menu_pressed" android:state_focused="true" /> </selector></span>
textcolor 设置selecter 报错: <item> tag requires a 'color' attribute or child tag defining a drawab
标签:
原文地址:http://blog.csdn.net/u013173289/article/details/45134267