本文实例讲述了Android编程之控件状态配置文件。分享给大家供大家参考,具体如下:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 无状态时 -->
<item
android:state_focused="false"
android:state_selected="false"
android:state_pressed="false"
android:state_enabled="true"
android:drawable="@drawable/blue" />
<!-- 选中状态 -->
<item
android:state_focused="false"
android:state_selected="true"
android:state_pressed="false"
android:state_enabled="true"
android:drawable="@drawable/blue" />
<!-- 获得焦点 -->
<item
android:state_focused="true"
android:state_selected="false"
android:state_pressed="false"
android:state_enabled="true"
android:drawable="@drawable/blue" />
<!-- 按下时的状态 -->
<item
android:state_focused="false"
android:state_selected="false"
android:state_pressed="true"
android:state_enabled="true"
android:drawable="@drawable/blue" />
</selector>
希望本文所述对大家Android程序设计有所帮助。
您可能感兴趣的文章:详解Android控件状态依赖框架