zoukankan
html css js c++ java
android checkbox样式
1. 首先要导入你准备用作CheckBox选中和补选中状态的两图片到res的drawable中,如checkbox_checked.png,checkbox_normal.png;
2. 在res/drawable中添加checkbox.xml,定义checkbox的state list drawable图片
[html]
view plain
copy
<?
xml
version=
"1.0"
encoding=
"UTF-8"
?>
<
selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<
item
android:state_checked=
"true"
android:drawable=
"@drawable/checkbox_checked"
/>
<!-- checked -->
<
item
android:state_checked=
"false"
android:drawable=
"@drawable/checkbox_normal"
/>
<!-- default -->
</
selector
>
复制
代码
3. 在Layout中修改checkbox的属性:android:button="@drawable/checkbox" 定制button样式
[html]
view plain
copy
<
CheckBox
android:layout_height=
"wrap_content"
android:id=
"@+id/chkItem"
android:button=
"@drawable/checkbox"
>
</
CheckBox
>
这样就完成了定制工作,效果如下:
查看全文
相关阅读:
053-49
053-3
053-204
053-491
053-205
053-57
053-149
053-47
053-150
回答2
原文地址:https://www.cnblogs.com/ada-zheng/p/3791058.html
最新文章
游戏 gui button
游戏 标签gui.label
浅谈MySQL索引背后的数据结构及算法
游戏 制作角色
java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [xxxAction]。
extjs grid
extjs 远程数据源
kmp 和boyer-moore
java多次替换(replace不行)
【leetcode】数字的补数
热门文章
【leetcode】位1的个数
【leetcode】回旋镖的数量
【leetcode】等价多米诺骨牌对的数量
【leetcode】好数对的数目
【leetcode】写字符串需要的行数
【leetcode】 最近的请求次数
【leetcode】字符串中的单词数
【leetcode】 将数字变成 0 的操作次数
【leetcode】在既定时间做作业的学生人数
053-275
Copyright © 2011-2022 走看看