Is there a way to style a RadioButton as a flat button? I have four options:
| btn1 | btn2 | btn3 | btn4 |
instead of having the little radio circle next to each, I'd like to show each as just a plain flat button. Is that possible without having to draw them myself?
Thanks
RadioButton is a two states button which is either checked or unchecked. If a single radio button is unchecked, we can click it to make checked radio button. Once a radio button is checked, it cannot be marked as unchecked by user.
Radio buttons are so called because they function like the channel presets on radios. A typical group of radio buttons. A group of radio buttons behaves like a single control. Only the selected choice is accessible using the Tab key, but users can cycle through the group using the arrow keys.
Yes it is possible.
In xml set,
android:button="@null"
And in case you want to do it dynamically, setButtonDrawable(new StateListDrawable());
Yes, you can change the drawable used for a radio button.
android:button
(or setButtonDrawable
) controls the image used for the circle. Set it to null if you want no image.
You could then set the background of the radio button with android:background
or setBackgroundResource
to a normal button-style background.
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