转载: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. 修改前后对比

更多相关文章

  1. Android webkit log定义
  2. Android使用xml自定义图片
  3. android 获取图片
  4. android 读取,写入图片到sd卡源码
  5. Android 图片缩放
  6. Android 取出 图片以字节形式存放到数据库的数据,并将图片显示
  7. android图片闪烁或帧动画

随机推荐

  1. android zbar二维码扫描(中文不乱码)
  2. CM android的CMUpdater分析(二)
  3. activity-alias使用
  4. Android系统集成有源码的第三方库和程序
  5. Android中用Application类实现全局数据变
  6. android 代码设置EditText的hint字符
  7. android通过包名跳转到系统闹钟
  8. android 兼容各个版本 读取通讯录
  9. Android中的URI 和Uri
  10. Android Hook 机制之简单实战