【发布时间】:2015-01-25 19:39:54
【问题描述】:
我想为我的文本字段定义一个颜色状态列表,在“激活”时默认使用 primaryTextColor 和 colorAccent。我的定义:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?android:attr/colorAccent" android:state_activated="true"/>
<item android:color="?android:attr/textColorPrimary"/>
</selector>
这不起作用(我总是得到一些红色,我猜这是将 id 解释为 argb 颜色)。
我可以做些什么来指定与主题相关的颜色?
【问题讨论】: