StateListDrawable(状态)资源属性
来源:互联网 发布:cnc编程教程 编辑:程序博客网 时间:2024/05/16 10:01
属性值 含义 android:state_active 代表是否处于激活状态 android:state_checkable 代表是否处于可勾选状态 android:state_checked 代表是否处于可勾选状态 android:state_endabled 代表是否处于可用状态 android:state_first 代表是否处于开始状态 android:state_focused 代表是否处于已得到焦点状态 android:state_last 代表是否处于结束状态 android:state_middle 代表是否处于中间状态 android:state_pressed代表是否处于已被按下状态 android:state_selected 代表是否处于已被选中状态 android:state_window_focused代表是否窗口已得到焦点状态
这个xml放在drawable文件夹(自己定义)下面 ,里面用的必须是<selector><item></item></selector>这个标签
<selector></selector>为根标签,<item></item>为资源
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 指定获取焦点时的颜色 -->
<item android:state_focused="true" android:color="#f44" ></item>
<!-- 指定失去焦点时的颜色 也可以称之为默认状态-->
<item android:state_focused="false" android:color="#000"></item>
</selector>
注意:默认选中状态一定要放在最下面
0 0
- StateListDrawable(状态)资源属性
- StateListDrawable资源
- StateListDrawable资源
- StateListDrawable资源
- StatelistDrawable 状态选择器失灵
- 资源文件之StateListDrawable
- Drawable资源----StateListDrawable
- Android-drawable资源-StateListDrawable
- StateListDrawable资源和ShapeDrawable资源的使用
- Drawable资源——StateListDrawable 资源
- StateListDrawable
- StateListDrawable
- StateListDrawable
- StateListDrawable与<selector>的各种状态
- Android中的Drawable资源—— StateListDrawable
- Android资源文件Res详解-StateListDrawable
- 初学Android,使用Drawable资源之使用StateListDrawable资源(十三)
- 属性资源
- java虚拟机的面试问题
- Linux指令学习笔记(一)
- 乐观锁和悲观锁
- 用AXIS2发布法WebService的方法
- Dart基础学习03--方法的使用
- StateListDrawable(状态)资源属性
- NYOJ 91 阶乘之和 (贪心)
- 揭秘云计算 为应用程序选择最佳云计算平台
- 设置系统环境变量需要重启吗?
- android实现沉浸式状态栏
- StringBuffer
- java网店系统JSPGOU 4.5
- linux常用命令(30):chgrp命令
- xml字符串转字符串树