我在仿写同事的一个功能模块的时候,引用了他的几个文件,之后出现了
“No resource identifier found for attribute 'mode' in package 'com.aaa.bbb”
com.aaa.bbb是同事的包。
我查了下看到了下面的问题,这个问题可以解决问题出在哪里了,网址:
http://bbs.youkuaiyun.com/topics/360065000
我希望做一个自定义的BUTTON,首先在attrs.xml中定义了
<declare-styleable name="MyButton">
<attr name="who" format="string" />
</declare-styleable>
多加了一个who属性
然后在main.xml中,
加命名空间了xmlns:t=" http://schemas.android.com/apk/res/com.limaoyuan.button"
然后在定义Button的地方
<com.limaoyuan.button.MyButton
t:who="aaad"/>
报No resource identifier found for attribute 'who' in package 'com.limaoyuan.button'
从上面可以看出来,这个问题是因为想自定义某个规则的时候,出现的。
解决办法上面的上面的地址也有,
在此重复一下,
把同事的com.aaa.bbb换成自己的manifest里面的包名就OK了。
可是我的不是这里的错,我最后,才知道是忘了引用
xmlns:ptr="http://schemas.android.com/apk/res/com.login.aaa"
这句话,它也会提示这个错误,因为找不到,所以也会报这个错误。