6

How to change border color of radio button in android?

I want to change circle color of android radio button.

Thanks in advance. Any help is greatly appreciated.

I have try different soluation and concern if any property is there other that drawable image

Abhijit Shelar
  • 1,055
  • 7
  • 21
  • 41

3 Answers3

23

Yes, this is the property you are looking for: buttonTint, but only works on api level 21 or above

<RadioButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/radio"
    android:checked="true"
    android:buttonTint="@color/your_color"/>

in your values/colors.xml put your color in this case a reddish one:

<color name="your_color">#e75748</color>

Result:

Colored Android Radio Button

Jorge Arimany
  • 5,814
  • 2
  • 28
  • 23
17

The easiest way to customize(change color) your views.

Goto : http://android-holo-colors.com/

  • Select the color you want for Radio Button
  • Download Output Resources (Download.Zip)
  • Extract zip contents
  • Copy files from extracted zip to your project drawables, styles and values
  • Change the parent of your app theme to the one you downloaded
  • And you have got what you wanted
andy
  • 18,005
  • 9
  • 30
  • 27
SKK
  • 5,261
  • 3
  • 27
  • 39
3

Try using AppCompatRadioButton

<android.support.v7.widget.AppCompatRadioButton
    android:id="@+id/rb"
    app:buttonTint="@color/colorAccent" //This to set your default button color
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

For more detail check this answer : Android: Change the color of RadioButtons and checkboxes programmatically

Community
  • 1
  • 1
Rana Ranvijay Singh
  • 6,055
  • 3
  • 38
  • 54