标签:android 手机 android平台 android开发 selector
目前网上大部分的color selector的方法都如初一则,方法如下
<span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true" android:color="#FFF" /> <item android:state_focused="true" android:color="#FFF" /> <item android:state_pressed="true" android:color="#FFF" /> <item android:color="#000" /> </selector></span>
<span style="font-size:14px;"><drawable name="menu_bg_normal">#00000000</drawable> <drawable name="menu_bg_pressed">#50000000</drawable></span>然后再定义drawable selector
<span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/stu_menu_bg_pressed"/> <item android:drawable="@drawable/stu_menu_bg_normal"/> </selector></span>
标签:android 手机 android平台 android开发 selector
原文地址:http://blog.csdn.net/applezp/article/details/39232189