Most of the time, we don't use the checkbox style of Android in our UI, so we need to define our own checkbox.
First look for two checkbox background images. For example:
Then define a background image XML file under the Drawable folder, such as the following:
<?xml version= "1.0" encoding= "Utf-8"? ><selector xmlns:android= "http://schemas.android.com/apk/res/ Android "> <item android:state_checked=" true "android:drawable=" @drawable/fuxuan_input01 "/> < Item android:state_selected= "True" android:drawable= "@drawable/fuxuan_input01" ></item> <item Android:state_pressed= "true" android:drawable= "@drawable/fuxuan_input01" ></item> <item android: State_checked= "false" android:drawable= "@drawable/fuxuan_input02"/></selector>
Define it where you need to use a checkbox. property settings, such as the following code, are seen:
<checkbox android:id= "@+id/agree_provision_chk" android:layout_width= "Wrap_content" android: layout_height= "Wrap_content" android:background= "@drawable/chk_agee_provision_background" android: button= "@null"/>
you define the checkbox to complete, such as what you see:
Android's own definition checkbox style