I'm using Android Studio. I need to change the color of the Radio Button, after changing the Button Tint Color value to the one I need it works on the preview, but whenever I launch the app on a device the button is the standard green/blue-ish color.
Is this some kind of device API level issue? If so, is it possible to change the color for older devices?
No need of additional styling. Android supports it via xml. Just add android:buttonTint="@color/yourColor" in your radio button.
For eg.
This can be done in two ways (to support pre-Lollipop):
Use
AppCompatRadioButton
:Apply this as style to your
RadioButton
in your XML:From: user2968401
Once you have different styles for the radio button you can swap them by assigning them to a new Radio Button with the style already set to the new style:
Assuming you are using appcompat in your app just add the below within styles.xml
Now blue colorAccent will be set, just change color to any color you want.
For eg, the whole style.xml
After reading @Ranjith's answer i did a little digging and this seemed to work. Just add it to your AppTheme.
My question is how do you do this programatically as I have dynamic radio buttons??