Kai
Kai

Reputation: 51

RadioButton Image

How would I modify the .xml and .java files so that a RadioButton shows one image when selected and another image when not selected?

Example for RadioButton I am learning from: http://www.androidpeople.com/android-radiobutton-example/

Upvotes: 1

Views: 5321

Answers (2)

bigstones
bigstones

Reputation: 15267

you need to set its android:button property to a StateListDrawable that has at least two states: selected=true and a default one (unselected).

Upvotes: 1

Here is an example that uses StateListDrawable and RadioButtons, and seems to do what you want.

Upvotes: 3

Related Questions