CheckBox修改大小:
1android:scaleX="0.8" 2android:scaleY="0.8"
CheckBox修改边框颜色,注意不是背景色:
android:buttonTint="@color/colorAccent"
修改大小和边框颜色:
1 <CheckBox 2 android:layout_width="wrap_content" 3 android:layout_height="match_parent" 4 android:gravity="center_vertical" 5 android:scaleX="0.8" 6 android:scaleY="0.8" 7 android:buttonTint="@color/colorAccent" 8 />
自定义CheckBox:
1 <CheckBox 2 android:id="@+id/spc_cb_shops" 3 android:layout_width="wrap_content" 4 android:layout_height="match_parent" 5 android:paddingLeft="@dimen/side_distance" 6 android:paddingRight="@dimen/side_distance" 7 style="@style/spc_checkbox_style" 8 /> 9 10 <!--购物车checkbox--> 11 <style name="spc_checkbox_style" parent="@android:style/Widget.CompoundButton.CheckBox"> 12 <item name="android:drawableLeft">@drawable/spc_cb</item> 13 <item name="android:button">@null</item> 14 </style> 15 16<?xml version="1.0" encoding="utf-8"?> 17<selector xmlns:android="http://schemas.android.com/apk/res/android"> 18 <item android:state_checked="true" android:drawable="@mipmap/select_button" /> 19 <item android:state_checked="false" android:drawable="@mipmap/select_button_gray" /> 20 <item android:drawable="@mipmap/select_button_gray" /> 21</selector> 22 23@mipmap/select_button是已选中样式,; 24 25@mipmap/select_button_gray是未选中样式;