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=" ...
随机推荐
- Java并发编程:ThreadLocal
Java并发编程:深入剖析ThreadLocal Java并发编程:深入剖析ThreadLocal 想必很多朋友对ThreadLocal并不陌生,今天我们就来一起探讨下ThreadLocal的使用 ...
- 天圆地方· 围棋界的盲棋天才 -- 鲍云
"鲍云是我心目中继 本因坊秀策,吴清源.武宫正树后第四个我最喜欢的棋手. " 说到盲棋,棋迷们首先想到的绝对是柳大华,外号"东方电脑"的他创造过中国象棋1对19 ...
- [Angular 2] Get start with Firebase
Create a Firebase Servcie: import {Injectable} from 'angular2/core'; import {Http, Response} from 'a ...
- LAMP php5.4编译 _php_image_stream_putc等问题
编译时出现下列问题时: In file included from /usr/local/src/php-5.4.6/ext/gd/gd.c:103: /usr/local/src/php-5.4.6 ...
- SVN经常使用命令说明
SVN版本号:1.5 及更新版本号 名词说明: WC:Working Copy 你的工作区 Versioned:受控的:受版本号控制的 SVN是什么? SVN是开源的版本号控制系统. 比CVS很多其它 ...
- java基础01
1. /** * JDK: (Java Development ToolKit) java开发工具包.JDK是整个java的核心! * 包括了java运行环境 JRE(Java Runtime Env ...
- C# DBNULL与NULL之间的区别【转】
null是.net中无效的对象引用.DBNull是一个类.DBNull.Value是它唯一的实例.它指数据库中数据为空(<NULL>)时,在.net中的值.null表示一个对象的指向无效, ...
- JavaScript基础(二)
一.外部引用语法<script src="script.js"></script> 二.在页面中的位置 1.我们可以将JavaScript代码放在html文 ...
- GDI+基础(3)
常用图形绘制 <%@ Page ContentType="image/gif" Language="C#" %> <!--ContentTyp ...
- 设计模式:模版模式(Template Pattern)
android中的Activity框架,View框架中大量的on函数基本上都应用到了Template模式,掌握这一模式对于理解这些框架大有裨益. 模版模式 又叫模板方法模式,在一个方法中定义一个算法的 ...