Is there an easy way to use a custom image for a checkbox? I'm looking to duplicate the "starred" behavior of gmail. So I want to have a checkbox that, when checked, is a filled in star. And when unchecked is an empty star. Do I have to use an imageview and do my own logic myself?
+1
A:
Checkboxes being children of Button you can just give your checkbox a background image with several states as described here, under "Button style":
http://developer.android.com/reference/android/widget/Button.html
...and exemplified here: http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList
Jean
2010-10-19 06:23:05
Thanks, I actually found exactly what I needed here http://it-ride.blogspot.com/2010/04/how-to-android-favorite-button-right.html but I would have had to do it your way if I wanted a __real__ custom image =P
Falmarri
2010-10-19 06:44:55