error: No resource identifier found for attribute ‘backIcon’ in package
异常提示:
今天我新创建了一个自定义控件,我为他定义了一个属性为backIcon,但是当我在xml设置这个属性之后,xml布局界面提示以下错误:
错误原因:
在网上查找错误原因的时候,有文章说这是因为我的布局文件的命名空间没有添加有包名的那个命名空间,可是我检查布局文件完毕之后,发现我已经添加了,但是还是报这个异常错误,我的命名空间为:xmlns:myview="http://schemas.android.com/apk/res/com.example.zhufu.view";后来我在另外一篇博文上终于发现了自己的错误原因,这个命名空间后面包名我添加错误了,命名空间后面的包名应该是AndroidManifest.xml文件中定义的package包名,而不是我使用的这个自定义控件所处的包的包名。
解决办法:
解决办法就是将我的布局命名空间改为xmlns:myview=http://schemas.android.com/apk/res/com.example.zhufu"即可,这样就可以使用我的自定义控件了。
参考链接:
http://blog.sina.com.cn/s/blog_6aefcbed01013rpc.html
error: No resource identifier found for attribute ‘backIcon’ in package的更多相关文章
- res\menu\main.xml:6: error: No resource identifier found for attribute 'showAsAction' in package 'com.xxx.xxxx'
res\menu\main.xml:6: error: No resource identifier found for attribute 'showAsAction' in package 'co ...
- 踩坑实录 使用 cardview 时报错 error: No resource identifier found for attribute 'cardCornerRadius' in package 'com.xxxxx.xxx'
在项目中引用 cardview 卡片布局,编译时 Android Studio 报出下面图片中红框标记的错误: 出现这种情况的原因在于没有导入 cardview 卡片布局相应的依赖包,因此我们需要在 ...
- apktool 回编译报错:No resource identifier found for attribute 'xxxxxx' in package 'android' W:
C:\xxxx\app-release\res\layout-v26\xxxx.xml:5: error: No resource identifier found for attribute 'xx ...
- Android 官网提供的Custom-view 编译出错--error: No resource identifier found for attribute
error: No resource identifier found for attribute in custom-views from http://developer.android.com ...
- Error:(108) No resource identifier found for attribute 'style' in package 'android'
Error:(108) No resource identifier found for attribute 'style' in package 'android' 解决方案: 这是错误的写法: a ...
- No resource identifier found for attribute 'showAsAction' in package 'android'
运行一个项目时在一个menu.xml文件item属性android:showAsAction 报错 No resource identifier found for attribute 'showAs ...
- Error:(12) No resource identifier found for attribute 'titles' in package 'com.itheima52.mobilesafe5
http://stackoverflow.com/questions/5819369/error-no-resource-identifier-found-for-attribute-adsize-i ...
- 自定义view中错误:No resource identifier found for attribute X in package X
- Library工程No resource identifier found for attribute
使用library工程中自定义属性无法识别问题 解决:xmlns:ptr="http://schemas.android.com/apk/res/包名, 改成xmlns:ptr=" ...
随机推荐
- js中的SetTimeOut
1. SetTimeOut() 1.1 SetTimeOut()语法例子 1.2 用SetTimeOut()执行Function ...
- ubuntu14.04 安装tar.gz文件
UBUNTU14.04 中tar.gz安装方法 # 是root用的,如果想一直用就要先root设置密码sudo passwd root.$ 一般用户 root@big-System-Product-N ...
- angularjs改变路由时控制器每次都执行两次
原因如下: 代码里面也初始化了控制器 模板配置了一个控制器
- 浅谈MVC模式
MVC模式(三层架构模式) (Model-View-Controller)是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型(Model).视图(View)和控制器(Controller ...
- Xamarin改写安卓Residemenu控件
1.下载最新的Residemenu安卓代码.用intellig打开,重新编译一下. 2.需要将其中的Residemenu,用gradle编译生成*.aar文件格式. 2.1 下载gradle,配置环境 ...
- Xml序列化自引用/循环引用问题1
1.定义类 public class Student { public int ID { get; set; } public string Name { get; set; } //[XmlIgno ...
- QQ群开放接口
http://qun.qq.com/open.html#click http://my.oschina.net/ij2ee/blog/191692
- Arcgis Desktop 9.3 安装
以下用到的 Crack在我的网盘中有: ref: http://pan.baidu.com/s/1pJJlVBl 密码: p4gk 一,安装 Desktop(依次按照如图安装): 二,配置 1,以上步 ...
- JavaScript 函数之 ------------------ 闭包
谈到闭包,人们常常会把匿名函数和闭包混淆在一起.闭包是指由权访问另一个函数作用域中的变量的函数.创建闭包的常见方式,就是在一个函数内部创建另一个函数,仍以前面的 createComparisonFun ...
- (七)Angularjs - 控制器
控制器的作用 没有控制器/controller,我们没有地方定义业务模型 比如:ng-init指令.我们可以使用ng-init指令在scope对象上定义数据 <div ng-init=" ...