Android中自定义checkbox样式
来源:互联网 发布:知乎首页 特效 编辑:程序博客网 时间:2024/05/04 03:36
1.首先在drawable文件夹中添加drawable文件checkbox_style.xml。
- <?xml version="1.0" encoding="utf-8"?>
- <selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/checkbox_pressed" android:state_checked="true"/>
- <item android:drawable="@drawable/checkbox_normal" android:state_checked="false"/>
- <item android:drawable="@drawable/checkbox_normal"/>
- </selector>
- <style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
- <item name="android:button">@drawable/checkbox_style</item>
- </style>
- <CheckBox
- android:id="@+id/select_all"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- style="@style/CustomCheckboxTheme" />
使用到的图片资源
checkbox_normal.png
checkbox_pressed.png
0 0
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- android中checkbox自定义样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- Android中自定义CheckBox样式
- Android中自定义CheckBox样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- android中checkbox自定义样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- android中CheckBox自定义样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- 禁止锁屏和隐藏标题栏
- 四分位数(定义、位置、数值)
- 1001. A+B Format (20):vector stack 简单运用
- PHP收邮件receiveMail
- 《Java编程思想》学习笔记9——集合容器高级
- Android中自定义checkbox样式
- oracle创建用户及分区
- Android fill_parent、wrap_content和match_parent的区别
- Js中自定义(创建)Map以及对应方法
- UISegmentedControl的所有操作总结
- 字符之殇——CHAR WCHAR
- 读书笔记-《人件》
- 《Java编程思想》学习笔记10——文件和目录常用操作
- 黑马程序员-java之反射