您的位置:首页 > 大数据 > 人工智能

Error: Found item Attr/font more than one time Error: Execution failed for task

2016-08-09 10:20 543 查看
在 attrs,xml 里面定义属性,有重复的属性时编译报错 Error: Found item Attr/font more than one time Error: Execution failed for task 

解决办法:

//定义属性

<attr name="titleTextSize" format="dimension" />
<attr name="titleTextColorRes" format="reference" />

//使用属性

<declare-styleable name="SettingItemView">
<attr name="titleTextSize" />
<attr name="titleTextColorRes" />
</declare-styleable>

<declare-styleable name="FilterView">
<attr name="titleTextSize" />
<attr name="titleTextColorRes" />
</declare-styleable>

这样书写后编译通过
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android attr
相关文章推荐