android studio的报错提示:AAPT: error: ‘#颜色‘ is incompatible with attribute drawable (attr) reference.
android studio的报错提示:AAPT: error: '#DCDCDC' is incompatible with attribute drawable (attr) reference.解决,打开selector_view_name_state.xml看看内容:<?xml version="1.0" encoding="utf-8"?><selector xmlns
·
android studio的报错提示:
AAPT: error: '#DCDCDC' is incompatible with attribute drawable (attr) reference.
解决,打开selector_view_name_state.xml看看内容:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#DCDCDC" android:state_pressed="true"/>
<item android:drawable="@color/cf2f2f2" android:state_pressed="false"/>
</selector>
错误译文是:drawable="#DCDCDC",改为drawable="@color/cdcdcdc",通过定义引入就兼容了
还是在color.xml里指定一下颜色,通过定义引入就兼容了
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 自定义的颜色 -->
<color name="cdcdcdc">#DCDCDC</color>
</resources>
更多推荐
已为社区贡献49条内容
所有评论(0)