自定义View XML文件出现No resource identifier found for attribute 'xxx' in package 'xxx.xxx.xxx'错误

自定义view XML文件出现No resource identifier found for attribute ‘xxx’ in package ‘xxx.xxx.xxx’错误解决方法

近期项目中,在更换包名以后,有自定义view的XML文件中出现No resource identifier found for attribute ‘xxx’ in package ‘xxx.xxx.xxx’问题,多番查找后发现问题出在xml文件的开头 xmlns:android_custom里面,必须将这里面的包名改成你现在引用的包名

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android_custom="http://schemas.android.com/apk/res/com.xxxx.xxxx" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/default_bg_color" >

xmlns:android_custom=”http://schemas.android.com/apk/res/com.xxxx.xxxx” 将XXXX后面的代码改成你所在的包名即可

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念