<CheckBox
android:id="@+id/account_checkBox_agree"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:button="@drawable/checkbox"
android:text="已阅读并同意"
android:textColor="#024089"
android:textSize="15sp"
android:checked="true"
android:singleLine="true"
android:layout_toLeftOf="@id/account_agreement_link"
android:layout_alignBottom="@id/account_agreement_link"
android:layout_centerVertical="true"
></CheckBox>

checkbox.xml 在drawable目录下

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_checked="true" android:state_focused="true"
android:drawable="@drawable/checkbox_on_background_focus_yellow" />

<item android:state_checked="false" android:state_focused="true"
android:drawable="@drawable/checkbox_off_background_focus_yellow" />

<item android:state_checked="false" android:state_focused="false"
android:drawable="@drawable/checkbox_off_background" />

<item android:state_checked="true" android:state_focused="false"
android:drawable="@drawable/checkbox_on_background" />

</selector>

之后再添加需要的效果图片即可

更多相关文章

  1. Android 缩放图片
  2. Android截屏及图片解析
  3. imageView动画效果
  4. Android 利用animation-list自定义progressbar动画出现图片平铺
  5. android中实现指针滑动的动态效果
  6. CardView 设置水波纹效果
  7. android-RadioButton背景使用图片
  8. 图片中的毕加索【Picasso】

随机推荐

  1. android Button源码分析
  2. 【记录】 Android 双卡手机获取两个IMEI
  3. MenuItemCompat.getActionProvider 返回
  4. 解决:Error: Could not find gradle wrapp
  5. 【Android Studio】几款好用的Android St
  6. Ubuntu 16.04环境下使用Clion 2019.1.4 g
  7. MDM - Mobile Device Management
  8. Ue4.20 安卓开发配置及Android Studio 调
  9. TextView属性总结
  10. android中LayoutParams设置参数的理解