Is it possible to create a button like radio button without using images?
Would like to have a pressed state upon selection. Then back to normal state when I click other options.
Is it possible to create a button like radio button without using images? Would
Share
simply include the respective drawables of the radio button in different states (i.e. focused, pressed, checked, or normal). Include these in a
selector.xmlto specify the looks of the button for the respective states, and include that xml in theandroid:backgroundattribute of your button. That should do it all…! 🙂Check this link to understand the method better: Change how a CheckBox looks
(it is given for a CheckBox, but similar stuff will work for button as a radio button as well).
Edit:
Define round_button.xml as below:
Then, wherever you need to include that button, just add the following:
[P.S.: Don’t forget to include the drawables for a round button, you’ll have to search them yourself, or get from the default files (.android), which is given in the link]