android-Color State List Resource
来源:互联网 发布:手机我要开淘宝网店 编辑:程序博客网 时间:2024/06/05 14:40
> A ColorStateList
is an object you can define in XML that you can apply as a color, but will actually change colors, depending on the state of the View
object to which it is applied. For example, a Button
widget can exist in one of several different states (pressed, focused, or neither) and, using a color state list, you can provide a different color during each state.
> XML file saved at res/color/button_text.xml
:
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="#ffff0000"/> <!-- pressed --> <item android:state_focused="true" android:color="#ff0000ff"/> <!-- focused --> <item android:color="#ff000000"/> <!-- default --></selector>
This layout XML will apply the color list to a View:
<Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/button_text" android:textColor="@color/button_text" />
0 0
- android-Color State List Resource
- Color State List Resource
- Color State List Resource
- Android API Guides---Color State List Resource
- Resource-type-->Color State List Resource
- Android Resource Types之Color State List 简介
- Android: Color State List Resource (颜色申明列表资源)
- The usage Color State List Resource
- android开发 color state list
- Color State List Resource(颜色状态列表资源)
- Android应用资源---状态颜色列表(Color State List)
- Android应用资源---状态颜色列表(Color State List)
- Android-Color State List用于控件在各状态下的文本颜色显示
- Android State List
- Android State List
- Android学习笔记--state list
- Android学习笔记--state list
- android学习之State List
- HTML规范
- 新浪微博Android SDK Java代码规范
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解决方法
- Spring中的事务控制
- iframe自适应高度
- android-Color State List Resource
- CCBPM多表单流程中关于绑定表单的设计步骤
- java 用ajaxFileUpload上传文件到指定目录
- 环形缓冲区
- 大数据量数据库优化
- android 拦截机制的分析
- Android Studio 环境搭建(windwos)
- 数据库连接池
- CUDA入门(2):设备查询