<selector xmlns:android="http://schemas.android.com/apk/res/android" >    <item android:drawable="@drawable/travel_main_tabhome_n" android:state_selected="true"/>    <item android:drawable="@drawable/travel_main_tabhome_n" android:state_focused="true"/>    <item android:drawable="@drawable/travel_main_tabhome_n" android:state_pressed="true"/>    <item android:drawable="@drawable/travel_main_tabhome_n" android:state_checked="true"/>    <item android:drawable="@drawable/travel_main_tabhome_c"/></selector>
android:state_pressed 是否按下,如一个按钮触摸或者点击。 android:state_focused 是否取得焦点,比如用户选择了一个文本框。 android:state_hovered 光标是否悬停,通常与focused state相同,它是4.0的新特性 android:state_selected 被选中,它与focus state并不完全一样,如一个list view 被选中的时候,它里面的各个子组件可能通过方向键,被选中了。 android:state_checkable 组件是否能被check。如:RadioButton是可以被check的。 android:state_checked 被checked了,如:一个RadioButton可以被check了。 android:state_enabled 能够接受触摸或者点击事件 android:state_activated 被激活(这个麻烦举个例子,不是特明白) android:state_window_focused 应用程序是否在前台,当有通知栏被拉下来或者一个对话框弹出的时候应用程序就不在前台了        

注意:如果有多个item,那么程序将自动从上到下进行匹配,最先匹配的将得到应用。(不是通过最佳匹配) 如果一个item没有任何的状态说明,那么它将可以被任何一个状态匹配。

补充详细说明链接

更多相关文章

  1. Android界面设计学习
  2. Android有效解决加载大图片时内存溢出的问题
  3. 自定义 RadioButton 选中和未选中时的图片
  4. Android之UI学习篇十一:ListView控件学习(一)
  5. Android(安卓)USB debugging 功能失效
  6. Android(安卓)判断是否能真正上网
  7. 解决android sdk中找不到tools目录Android(安卓)sdkmanager tool
  8. Android(Java):Android(安卓)ListView checkbox 全选效果
  9. Android版本和API Level , ADT对应关系

随机推荐

  1. Android蓝牙开发浅析
  2. android:inputType标签
  3. Android(安卓)EditText属性
  4. Android(安卓)资源文件中@、@android:typ
  5. android:launchMode="singleTask" intent
  6. android EditText输入限制
  7. TextView(标签控件)
  8. Android(安卓)TextView行间距解析
  9. Android系统自带样式(android:theme)
  10. Android(安卓)SDK下载和更新失败的解决方