<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给view比如layout等添加阴影效果
  3. Android(安卓)studio 签名 报错:Could not download groovy-all.j
  4. 关于Android(安卓)如何配置测试类
  5. imageView动画效果
  6. Android(安卓)Button 上添加图片
  7. RecylcerView中的子view matchParent属性失效的问题
  8. GridLayout 使用总结
  9. android中实现指针滑动的动态效果

随机推荐

  1. Android(安卓)ScrollView用法
  2. delphi XE Android四大组件ContentProvid
  3. android裁剪图片
  4. android 控件绘制完成的监听
  5. android fp refresh
  6. android 图片的自由缩放和旋转
  7. Android又一个超漂亮的日历控件
  8. Android常用功能
  9. Android短信拦截
  10. Google公布Android 4.1完整功能