我正在尝试TextView
使用以下代码为 textColor 设置选择器:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="?android:attr/textColorTertiary" />
<item android:color="?android:attr/textColorPrimary"/>
</selector>
但是,颜色总是出现red
而不是那些theme colors
。如果我输入硬编码颜色,一切似乎都正常。(例如<item android:state_enabled="false" android:color="#666666" />
)。
问题是什么以及如何解决?PS如果有人知道如何为列表中的禁用项目设置主题的默认禁用颜色,请分享,这就是我想要实现的。谢谢。