In previous post “Custom Button” we know how to customize a default Button of Android.
Similarly, in this post, I will show you the way to customize default Radio Button and Checkbox using XML file and desired images.
Copy these images to res/drawable folder:
Define an XML file to specify desired appearance for each state of Radio Button:
Declare Radio Buttons in main activity layout:
Remember to assign button attribute to the XML file we defined before.
Do the similar steps with Checkboxes:
Firstly is custom images:
Assign value to Checkbox button attribute:
And the result is so … fabulous: