2015-11-15 75 views

回答

2

更简单,只需设置buttonTint颜色:(仅适用于API级别21或以上)

<RadioButton 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:id="@+id/radio" 
android:checked="true" 
    android:buttonTint="@color/your_color"/> 
在你的价值观

/colors.xml把你的肤色在这种情况下,一个红色之一:

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

您需要将drawable设置为RadioButton才能更改颜色和边框或其他任何部分。

你可以在这里找到更多的信息:RadioButton - how to use a custom drawable?

可以使用tint功能,但是这将无法工作在旧设备。如果您不支持< API 21,请选择此项。

相关问题