I'm trying to apply custom image to checkbox in android, for this I create an check_custom.xml
file in which I define custom image for different states of check box like:
<item android:state_checked="true"
android:drawable="@drawable/btn_check_on" /> <!-- checked -->
<item android:state_checked="false"
android:drawable="@drawable/btn_check_off" /> <!-- unchecked -->
<item android:state_focused="true"
android:drawable="@drawable/btn_check_onfocus" /> <!--on focus-->
<item android:drawable="@drawable/btn_check_off" /> <!-- default -->
Three different images on three states on checked,on focus and on unchecked, and then I assign this xml file to background attribute of check boxes,but I'm not getting required result, this technique apply the custom image as well as default image both.