我正在尝试CompoundButton.CheckBox
使用官方 material.io 教程进行样式设置:
<style name="Widget.App.CheckBox" parent="Widget.MaterialComponents.CompoundButton.CheckBox">
<item name="buttonTint">@color/button_tint</item>
</style>
并且在color/button_tint.xml:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color=">@color/shrine_pink_900" android:state_checked="true"/>
<item android:alpha="0.38" android:color="@color/shrine_pink_100" android:state_enabled="false"/>
<item android:color="@color/shrine_pink_100"/>
</selector>
按下检查复选框时,我无法设置的是连锁效果的颜色:
我看到这种颜色是具有透明度的默认绿色,我需要使用蓝色。试图在选择器中使用复选框状态,但没有运气。
官方文档:https ://material.io/develop/android/components/checkboxes