How to change the color of the switch frame in android?

How to change the color of the switch frame in android?

I want to change the circle color of the android radio button.

Thanks in advance. Any help is appreciated.

I have tried various trick and anxiety if any property has another which may be reversible

+6
android android-ui
Apr 25 '13 at 11:10
source share
4 answers

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

Go to: http://android-holo-colors.com/

  • Select the color you want for the radio button.
  • Download Output Resources (Download.Zip)
  • Extract zip content
  • Copy files from extracted zip to your project drawings, styles and values
  • Change the parent of the application theme to the one you downloaded.
  • And you have what you wanted.
+17
Apr 25 '13 at 11:17
source share

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

<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 /colors.xml values ​​put your color in this case reddish:

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

Result:

Colored Android Radio Button

+19
Apr 10 '15 at 0:03
source share

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"/> 

See this answer for more details: Android: programmatically change the color of RadioButtons and checkboxes

+3
Jul 25 '16 at 10:57
source share

I think you are trying to set up a built-in switch. try this link. It's your decision. The full finale. Click here .

+2
Apr 25 '13 at 11:18
source share



All Articles