I have to customize checkbox image in my work, finally i found the solution at how-to-change-default-images-of-checkbox , it works well by using 'android:button' attribute, but left me another problem, checkbox with 'android:button' attribute applied, become hard to check and uncheck.
Following is the selector for Checkbox:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/gn_checkbox_checked" android:state_checked="true"/>
<item android:drawable="@drawable/gn_checkbox_normal" android:state_checked="false"/>
<item android:drawable="@drawable/gn_checkbox_normal"/>
</selector>
And the checkbox using this selector:
<CheckBox
android:id="@+id/timeline_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/checkbox"
android:layout_marginRight="3dp" />
Notes: Without 'android:button' attribute, checkbox is easy to check and uncheck, is there an elegant way to solve this problem? Thanks a lot.