android checkbox 定制(修改checkbox 的图片)
16lz
2021-12-04
转载:http://www.bangchui.org/read.php?tid=10861
1. xml中通过android:button="@drawable/check_box" 指定图片
<CheckBox android:text="CheckBox" android:id="@+id/checkBox1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/check_box" >
2. check_box定义在xml中
<?xml version="1.0" encoding="utf-8"?><!-- This is the rating bar drawable that is used to a show a filled star. --><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="false" android:state_enabled="true" android:drawable="@drawable/checkbox_off" /> <item android:state_checked="true" android:state_enabled="true" android:drawable="@drawable/checkbox_on" /> </selector>3. 修改前后对比
更多相关文章
- Android使用xml自定义图片
- android 自定义输入框
- Android使用系统分享文件给微信,QQ指定的用户
- 【email】android邮件Email
- ContentProvider
- 切换选项卡
- CreateProcess error=2, 系统找不到指定的文件。
- android viewPage 判断是否到最后一页
- Android高手进阶教程(二十七)之---基于ViewFlipper实现的自定义