1. First add the drawable file Checkbox_style.xml in the Drawable folder.
<?xml version= "1.0" encoding= "Utf-8"? ><selector xmlns:android= "http://schemas.android.com/apk/res/ Android "> <item android:drawable=" @drawable/checkbox_pressed "android:state_checked=" true "/> <item Android oid:drawable= "@drawable/checkbox_normal" android:state_checked= "false"/> <item android:drawable= "@drawable/ Checkbox_normal "/></selector>
2. Add the Customcheckboxtheme style to the Styles.xml file under the Values folder.
<style name= "Customcheckboxtheme" parent= "@android: Style/widget.compoundbutton.checkbox" ><item name= " Android:button "> @drawable/checkbox_style</item></style>
3. Use the Customcheckboxtheme style in the layout file.
<checkbox android:id= "@+id/select_all" android:layout_width= "Wrap_content" android:layout_he ight= "Wrap_content" style= "@style/customcheckboxtheme"/>
Picture resources to use
Checkbox_normal.png
Checkbox_pressed.png
Customize checkbox style in Android