res与res-auto的区别——AndroidStudio自定义属性xmlns无法识别有关问题
2016-01-29 22:38
525 查看
res与res-auto的区别——AndroidStudio自定义属性xmlns无法识别问题
res与res-auto的区别
通常我们在布局文件中使用自定义属性的时候
会这样写
xmlns:app="http://schemas.android.com/apk/res/包路径"
但如果你当前工程是做为lib使用,那么你如上所写 ,会出现找不到自定义属性的错误 。
这时候你就可以 写成
xmlns:app="http://schemas.android.com/apk/res-auto"
摘自: http://blog.csdn.net/altair86/article/details/34438989
问题来源:
eclipse导出为 generate gradle build files后
在项目中使用自定义属性报错
xmlns:cascade="http://schemas.android.com/apk/res/com..."
Multiple annotations found at this line:
- When using a custom namespace attribute in a library project, use the namespace "http://schemas.android.com/apk/res-auto"
instead.
- Unused namespace cascade
解决:
删除导出时的所有生成文件和文件夹
而在AnroidStudio 中使用自定义属性xmlns的时候
正如in Gradle projects,always usehttp://schemas.android.com/apk/res-auto for custom attributes所说的
将eclipse中 http://schemas.android.com/apk/res/com.xxx.xxx
换成 http://schemas.android.com/apk/res-auto
摘自: http://blog.csdn.net/nwsuafer/article/details/42121521
res与res-auto的区别
通常我们在布局文件中使用自定义属性的时候
会这样写
xmlns:app="http://schemas.android.com/apk/res/包路径"
但如果你当前工程是做为lib使用,那么你如上所写 ,会出现找不到自定义属性的错误 。
这时候你就可以 写成
xmlns:app="http://schemas.android.com/apk/res-auto"
摘自: http://blog.csdn.net/altair86/article/details/34438989
问题来源:
eclipse导出为 generate gradle build files后
在项目中使用自定义属性报错
xmlns:cascade="http://schemas.android.com/apk/res/com..."
Multiple annotations found at this line:
- When using a custom namespace attribute in a library project, use the namespace "http://schemas.android.com/apk/res-auto"
instead.
- Unused namespace cascade
解决:
删除导出时的所有生成文件和文件夹
而在AnroidStudio 中使用自定义属性xmlns的时候
正如in Gradle projects,always usehttp://schemas.android.com/apk/res-auto for custom attributes所说的
将eclipse中 http://schemas.android.com/apk/res/com.xxx.xxx
换成 http://schemas.android.com/apk/res-auto
摘自: http://blog.csdn.net/nwsuafer/article/details/42121521
相关文章推荐
- android+NDK+Mac安装
- Android--viewpager
- Android 简单欢迎页面设计
- Android 带固定图片的EditText
- Android基础之Activity的生命周期
- Android--viewpager学习
- android 导入数据库
- AndroidStudio学习笔记
- Android Studio 生成APK出现的「前言不允许有内容」错误
- Android 中ViewPager+fragment报异常:IllegalStateException:Can't change tag of fragment的一种解决思路
- Android--viewpager学习
- xml读取.sax解析方式 使用于Android 和java中 ,代码是java的, 在Android中只需要 区别监听类中的参数(localName,qName),相反的,java中使用qname 为节点的名称;
- Android 基础 —— 活动的生存周期
- Android 基础 —— 活动的启动模式
- Android 主题切换
- Android 四大组件 —— 服务
- Android特色服务之定位服务(百度地图开发一)
- android Broadcast 生命周期详细分析
- Android中实现静态的默认安装和卸载应用
- Android 一行显示全部内容的TextView--SingleLineTextView