我想在one of my projects中更改RadioButton的圆的颜色,但我不知道要设置哪个属性。背景颜色是黑色,因此它变得不可见。我想将圆圈的颜色设置为白色。
发布于 2016-03-05 00:24:10
<android.support.v7.widget.AppCompatRadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:buttonTint="@color/Color" />
发布于 2017-05-04 23:57:08
您必须使用以下代码:
<android.support.v7.widget.AppCompatRadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Radiobutton1"
app:buttonTint="@color/black" />
使用app:buttonTint
而不是android:buttonTint
,使用android.support.v7.widget.AppCompatRadioButton
而不是Radiobutton
!
发布于 2017-01-14 18:24:48
您可以使用XML中的样式来更改单选按钮的未选中和选中状态的颜色。
<RadioButton
android:id="@+id/rb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/RadioButtonStyle" />
在style.xml中
<style name="RadioButtonStyle" parent="Theme.AppCompat.Light">
<item name="colorAccent">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
</style>
您可以在此样式中设置所需的颜色。
https://stackoverflow.com/questions/17120199
复制相似问题