android checkbox 定制(修改checkbox 的图片)
16lz
2021-01-23
转载: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 webkit log定义
- Android使用xml自定义图片
- android 获取图片
- android 读取,写入图片到sd卡源码
- Android 图片缩放
- Android 取出 图片以字节形式存放到数据库的数据,并将图片显示
- android图片闪烁或帧动画