为什么 MaterialRadioButton 在我禁用它时会改变它的颜色?

Why MaterialRadioButton changing its color when I disable it?

我正在使用 MaterialRadioButton,当我使用 android:enabled="false" 禁用它时,圆圈颜色变为白色,但我想要相同的颜色,无论是否启用它 true 或 false

XML

<com.google.android.material.radiobutton.MaterialRadioButton
    android:id="@+id/radio_test"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="5dp"
    android:text="@string/test"
    android:textColor="@color/white"
    android:textSize="15sp"
    android:enabled="false"
    android:theme="@style/MaterialRadioButton" />

主题

<style name="MaterialRadioButton">
    <item name="colorSecondary">#66BB6A</item>
    <item name="colorOnSurface">#FFFFFF</item>
</style>

您应该使用 xml 中的“buttonTint”属性来为您的单选按钮修复一些颜色。