You might want to create your own CheckBox custom style, and RadioButton custom style in Android, for your applications.
This is how you can achieve it, in a few steps:
-Create Image Drawables for their two stater (checked/unchecked).
-Create selector for this two drawables. The sample content should be something like this:
1 2 3 4 5 | <?xml version="1.0" encoding="utf-8"?> <item android:state_checked="true" android:drawable="@drawable/unchecked" /> <item android:state_checked="false" android:drawable="@drawable/checked" /></selector> |
-Add this selector as android:button attribute for CheckBox or RadioButton
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/background"> <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/checkbox_selector" android:text="Custom CheckBox" /> <RadioButton android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/checkbox_selector" android:text="Custom RadioButton" /></LinearLayout> |
You can download this code: download code