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
>
这样就完成了定制工作,效果如下:
查看全文
相关阅读:
linux下的make命令
安装pytorch
CondaError: Downloaded bytes did not match Content-Length
cv2.VideoCapture(0)
cv2.imread(),cv2.imshow(),cv2.imwrite()
unsqueeze()和squeeze()
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module
Can't connect to MySQL server on '127.0.0.1' (10061)
ping ip
_vimrc配置
原文地址:https://www.cnblogs.com/ada-zheng/p/3791058.html
最新文章
信号量在多线程通讯运用
Java9以后的垃圾回收
史上最全HashMap遍历方式
python TKinter的主窗口运行程序完毕后,怎么让其自动关闭
Tkinter最佳实践(半小时)
解决最新Java12 安装
Python的定时器与线程池
Python的条件锁与事件共享
Python的互斥锁与信号量
Swing 实现的Gui链表
热门文章
《C程序设计II》简易计算器,杨辉,数字杯子图形
网络工程18级《C++程序设计II》实践作业1
每周一题之6 快速过桥
第5周题目:翻硬币
第4周题目.高斯的日记
X星球居民小区的楼房全是一样的...
安装pycocotools
终端和python环境之间的转换
linux命令rm -rf
有对应的文件夹和py文件import却显示没有模块(亲测有效)
Copyright © 2011-2022 走看看