I want to know how to change color of circle and border of radio button in android.please help me i trying this for two days.
Asked
Active
Viewed 1.2k times
2
-
see this post https://stackoverflow.com/a/52802572/4797289 – Rasoul Miri Oct 14 '18 at 12:22
2 Answers
5
More simple, just set the buttonTint color: (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>

Subho
- 539
- 1
- 9
- 25
0
You need to set drawable
to your RadioButton
to change the color and border or any other part of it.
You can find more info here: RadioButton - how to use a custom drawable?
You can use the tint
feature, but this won't work in older devices. Choose this if you are not supporting < API 21.