No resource identifier found for attribute 'mode' in package 'com.aaa.bbb'

我在仿寫同事的一個功能模塊的時候,引用了他的幾個文件,之後出現了

“No resource identifier found for attribute 'mode' in package 'com.aaa.bbb”

com.aaa.bbb是同事的包。

我查了下看到了下面的問題,這個問題可以解決問題出在哪裏了,網址:

http://bbs.csdn.net/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"

這句話,它也會提示這個錯誤,因爲找不到,所以也會報這個錯誤。







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章