自定义 CheckBox样式
来源:互联网 发布:linux 改变文件夹权限 编辑:程序博客网 时间:2024/06/06 00:02
1、首先res/drawable中定义编写如下样式:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/check_true" android:state_checked="true"></item> <item android:drawable="@drawable/check_true" android:state_selected="true"></item> <item android:drawable="@drawable/check_true" android:state_pressed="true"></item> <item android:drawable="@drawable/check_false"></item> </selector>
2、在layout中添加checkbox控件:
<CheckBox android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btn_check" android:button="@null" android:checked="true"/>
其中drwable/btn_check是定义的文件名称,另外必须将android:button设置为@null。
@drawable/check_true和@drawable/check_false为checkbox不同状态的图片,可自行设计。
0 0
- 自定义 checkbox 样式
- android CheckBox 自定义样式
- Android 自定义CheckBox 样式
- 自定义checkbox样式
- 自定义CheckBox 样式
- android 自定义checkbox 样式
- Android 自定义CheckBox样式
- Android自定义checkbox样式
- 自定义checkbox样式
- 自定义checkbox样式
- 自定义CheckBox样式
- 自定义CheckBox样式
- android 自定义checkbox 样式
- 自定义Checkbox样式--Android
- Android 自定义CheckBox 样式
- 自定义 CheckBox样式
- 自定义checkbox样式
- 自定义checkbox 样式
- hdu3622 2-SAT+二分
- Gym 100641 H Time Warp || 追击问题
- JavaScript语法
- POJ-3250-Bad Hair Day- 又是一颗单调栈
- HDU - 4271(经典字符串dp改)
- 自定义 CheckBox样式
- 窗口中的对象和元素
- shwoModalDialog弹出窗的属性
- Spring+Axis1.4开发WebService实例
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 内置对象 DOM BOM
- CvMat、Mat、IplImage之间的转换
- Android性能优化典范(一)
- awk基础