views:

63

answers:

1

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
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