您的位置:首页 > 其它

自定义view中xml属性 提示Attribute "XXX" has already been defined

2014-10-23 20:02 429 查看
在自定义view的declare-styleable中提示:error: Attribute "radius" has already been defined

原因:

不同的自定义view的自定义的名字也还是不能一样

深入:

在自定义的view中,我们引入xmlns:my="http://schemas.android.com/apk/view包名" ,
在android studio中,我们使用xmlns:my="http://schemas.android.com/apk/res-auto"

调用的时候就直接:materialbtn:materialButton_background="#000000"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐