I am trying to create custom Check Box button image. After some research, I came across this code sample:
<CheckBox android:id="@+id/chkFav" android:layout_width="wrap_content"
android:layout_marginRight="0dp" android:button="@drawable/checkbox"
android:layout_height="wrap_content" android:clickable="true"/>
My query is how to actually implement android:button in code.
setButtonDrawable(Drawable d) is the way to go for. Make sure it is state-list drawable to respond to user interaction.
Step By step instruction
**Notes-- there are many ways to achieve. This is just one simple way to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With