android点击Button后,buttton的背景和颜色改变
来源:互联网 发布:程序员 英文面试 编辑:程序博客网 时间:2024/05/01 11:01
android:background="@drawable/et_bg"
android:textColor="@drawable/login_btn_textcolor"
/>
背景代码:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_focused="true" android:drawable="@drawable/et_bg_press" /> <!-- focused -->
<item android:state_pressed="true" android:drawable="@drawable/et_bg_press" /> <!-- pressed -->
<item android:state_selected="true" android:drawable="@drawable/et_bg_press" /> <!-- pressed -->
<item android:drawable="@drawable/tv_bg" /> <!-- default --> //没有pressed时button的背景
</selector>
颜色代码
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_focused="true" android:color="@color/white" /> <!-- focused -->
<item android:state_pressed="true" android:color="@color/white" /> <!-- pressed -->
<item android:state_selected="true" android:color="@color/white" /> <!-- pressed -->
<item android:color="@color/title" /> <!-- default --> //没有pressed时button的颜色
</selector>
- android点击Button后,buttton的背景和颜色改变
- android button点击背景改变颜色
- Button点击背景和字体颜色改变的实现方法
- ListView中的Button点击后相应的Item改变背景颜色
- Android开发技巧:点击Button改变其背景颜色
- 【android】关于点击button1后改变颜色且保持,再点击别的button后颜色改变,button1变回原色
- Android点击View改变字体颜色和边框背景
- 改变android5.0Button的背景颜色
- Button和RelativeLayout点击时会改变颜色
- Android TextView的点击效果之改变背景颜色
- Android 设置按钮点击时候颜色背景的改变
- 实现listview条目点击后改变item背景颜色和字体颜色并保留
- 点击改变背景颜色
- TextView点击后背景颜色、文字颜色改变
- (转)TextView点击后背景颜色、文字颜色改变
- Button 点击后改变颜色 (不是点击后改变颜色又恢复)
- Android中的Button自定义点击效果之改变点击时按钮的颜色
- UIButton点击后改变背景的方法
- xcode 快速 复制 或者 删除一行插件xcodeKit
- stm32中断服务函数的机制
- AAC音频格式分析与解码
- 用maven生成HBase官方指南文档
- 跑马灯效果动画
- android点击Button后,buttton的背景和颜色改变
- python访问ftp
- 就回家回家
- 黑马程序员-Set-HashSet-TreeSet-Comparator-Comparable
- xcode6.1制作framework指引
- 面试 C++ 程序员,什么样的问题是好问题?
- android emulator 启动模拟器设置内置存储大小
- 近来,不好
- 银行柜面系统将是linux的天下