android 写 selector.xml 时的注意事项
来源:互联网 发布:计算机维护与网络管理 编辑:程序博客网 时间:2024/05/24 07:23
原文链接:http://developer.android.com/guide/topics/ui/controls/button.html
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button_pressed" android:state_pressed="true" /> <item android:drawable="@drawable/button_focused" android:state_focused="true" /> <item android:drawable="@drawable/button_default" /></selector>
Note: The order of the <item>
elements is important. When this drawable is referenced, the <item>
elements are traversed in-order to determine which one is appropriate for the current button state. Because the default bitmap is last, it is only applied when the conditions android:state_pressed
andandroid:state_focused
have both evaluated as false.
注意: <item> 元素的顺序非常重要。当这个 drawable 被引用时,<item> 元素会以中序(in-order)的方式被遍历,以确定哪个比较恰当地对应当前的 button 状态。由于 默认bitmap 是最后面的,只有当条件 android:state_pressed 和 android:state_focused 同时为 false 时,才会使用到它
0 0
- android 写 selector.xml 时的注意事项
- Android写xml布局时的注意事项
- android 使用selector的注意事项
- Android中selector的使用方法及注意事项
- 关于Android中selector的一点注意事项
- 写TextView的Selector了解到的android读取xml文件的几点规则
- textView、imageView设置selector时的注意事项
- Android decodeStream selector xml的方法
- Android XML 文件 中 的 selector、shape
- 使用xml写一个关于textSize的selector
- android selector.xml写法
- Android View设置背景为selector的注意事项
- android使用selector实现按下去的效果注意事项
- 写selector的xml文件时,需注意item的顺序,不带状态的item放在最后,否则selector无效
- 写selector的xml文件时,需注意item的顺序,不带状态的item放在最后,否则selector无效
- android xml 背景选择器selector
- android xml set,selector,shape
- Android XML绘图之 Selector
- keep up the good spirit
- 有限状态机的实现方式
- hadoop常见问题
- MATLAB基本操作(一):MATLAB中变量的文件存储
- commons-dbcp commons-pool 包缺失报错处理
- android 写 selector.xml 时的注意事项
- (19)基础加强-反射-类加载器的使用
- 角点匹配方法(总结篇)
- alter index rebuild 与 drop create index效率分析
- jboss启动
- cpio命令用法
- mybatis_oracle 入门案例
- Extjs4.2 Html 编辑器扩展
- Httpwatch抓包显示ERROR_INTERNET_CONNECTION_RESET问题