【发布时间】:2019-08-26 06:55:00
【问题描述】:
我正在尝试更改 SwitchCompat 中“禁用”状态的颜色。我在 Styles.xml 中添加了这个:
<style name="SwitchTheme" parent="Theme.AppCompat.Light">
<item name="android:colorControlActivated">#148E13</item>
<item name="android:colorSwitchThumbNormal">#FF0000</item>
</style>
编译时出现以下错误:
error: style attribute 'android:attr/colorSwitchThumbNormal' is private.
如果我评论该行,我没有错误,并且应用程序安装没有问题。我检查了this,但我认为我的 xml 文件中没有错误,因为我会通过评论该行收到错误...我也没有流氓 xml 文件,也没有流氓活动...有没有人遇到过这个问题?如何修复它,并更改我的开关禁用颜色?
谢谢。
【问题讨论】:
标签: android xml android-switch