需要在styles.xml文件下重新定义一个样式
<style name="CustomCheckBox" parent="@android:style/Widget.CompoundButton.CheckBox"> <item name="android:button">@drawable/driver_select</item> </style>
然后在xml文件夹下把刚刚定义好的样式设置一下就可以了
<CheckBox android:id="@+id/checkbox_driver" android:layout_width="wrap_content" android:layout_height="match_parent" style="@style/CustomCheckBox" />