您的位置:首页 > 其它

No resource identifier found for attribute X in package X

2015-04-13 18:30 316 查看


自定义view中错误:No resource identifier found for attribute X in package X

分类: Android xml2013-10-13
11:22 6751人阅读 评论(3) 收藏 举报

Androidxml自定义view

今天在写一个自定义view时,加入了通过xml传递参数,但是xml出现了No resource identifier found for attribute X in package X,我看了下教程感觉好像基本上代码差不多,后来查了google,发现这个声明的命名空间需要和androidManifest中的package对应,即命名空间为

[html] view
plaincopy





<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.tino.fingerscanning"

android:versionCode="1"

android:versionName="1.0" >

中的xmlns:android中后面的命名空间去掉android加上package中的路径,比如我的xmlns应该是

xmlns:myswitch="http://schemas.android.com/apk/res/ com.tino.fingerscanning"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐