Android中自定义checkbox样式 two
来源:互联网 发布:淘宝代付有限额吗 编辑:程序博客网 时间:2024/05/22 03:23
1.首先在drawable文件夹中添加drawable文件checkbox_style.xml。
- <?xmlversion="1.0"encoding="utf-8"?>
- <selectorxmlns:android="http://schemas.android.com/apk/res/android">
- <itemandroid:drawable="@drawable/checkbox_pressed"android:state_checked="true"/>
- <itemandroid:drawable="@drawable/checkbox_normal"android:state_checked="false"/>
- <itemandroid:drawable="@drawable/checkbox_normal"/>
- </selector>
2.在values文件夹下的styles.xml文件中添加CustomCheckboxTheme样式。
- <stylename="CustomCheckboxTheme"parent="@android:style/Widget.CompoundButton.CheckBox">
- <itemname="android:button">@drawable/checkbox_style</item>
- </style>
3.在布局文件中使用CustomCheckboxTheme样式。
- <CheckBox
- android:id="@+id/select_all"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- style="@style/CustomCheckboxTheme"/>
使用到的图片资源
0 0
- Android中自定义checkbox样式 two
- 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样式
- 按位与、按位异或、按位取反
- 灯火阑珊处等你回眸
- HDU 3711 Binary Number
- Android Mainfest配置
- Android中自定义checkbox样式 two
- 嵌入式中通讯协议的设计
- HDU 1004 Let the Balloon Rise
- Android自定义扁平化对话框
- 解决Ubuntu下Sublime text 2的中文输入问题(使用fcitx输入法)
- C++ 中常用数学函数
- 吃鱼胆导致急性肝衰肾衰的患者
- 存储过程中简单事务书写方法
- 搜狗浏览器保存的密码如何查看