20151227-01 [工程配置] error: Error retrieving parent for item: No resource found that matches the give
2015-12-27 22:22
295 查看
1、直接删除parent=。。。
2、
转:http://www.devdiv.com/forum.php?mod=viewthread&tid=89826&page=1#pid557155
有时候在定义自己的style文件时会报:
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Widget.TextView.ListSeparator.White'.
我的style定义如下:
<style name="ListSeparator" parent="@android:style/Widget.TextView.ListSeparator.White">
<item
name="android:background">@drawable/light_header_dither</item>
<item
name="android:textColor">#ffEE2C2C</item>
</style>
提示错误大体是说,找不到我继承的style。
parent="@android:style/Widget.TextView.ListSeparator.White"表示继承系统的style。
查看源码可以看到系统定义如下:
<style
name="Widget.TextView">
<item
name="android:textAppearance">?android:attr/textAppearanceSmall</item>
<item
name="android:textSelectHandleLeft">?android:attr/textSelectHandleLeft</item>
<item
name="android:textSelectHandleRight">?android:attr/textSelectHandleRight</item>
<item
name="android:textSelectHandle">?android:attr/textSelectHandle</item>
</style>
<style
name="Widget.TextView.ListSeparator.White">
<item
name="android:textColor">?textColorPrimaryInverse</item>
<item
name="android:background">@android:drawable/light_header_dither</item>
</style>
但Eclipse只能链接到Widget.TextView这一层。
可能的原因是要不sdk没有这个style或者是这个style被设置为不公开的了。
对于非public的xml属性,可以在“@”后加个"*"解决,如下:
<item name="android:windowTitleStyle">@*android:style/Widget.TextView.ListSeparator.White</item>
或者有一个比较笨的方法,就是把源码里的那个style复制过来放到自己的xml里然后引用。
2、
转:http://www.devdiv.com/forum.php?mod=viewthread&tid=89826&page=1#pid557155
有时候在定义自己的style文件时会报:
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Widget.TextView.ListSeparator.White'.
我的style定义如下:
<style name="ListSeparator" parent="@android:style/Widget.TextView.ListSeparator.White">
<item
name="android:background">@drawable/light_header_dither</item>
<item
name="android:textColor">#ffEE2C2C</item>
</style>
提示错误大体是说,找不到我继承的style。
parent="@android:style/Widget.TextView.ListSeparator.White"表示继承系统的style。
查看源码可以看到系统定义如下:
<style
name="Widget.TextView">
<item
name="android:textAppearance">?android:attr/textAppearanceSmall</item>
<item
name="android:textSelectHandleLeft">?android:attr/textSelectHandleLeft</item>
<item
name="android:textSelectHandleRight">?android:attr/textSelectHandleRight</item>
<item
name="android:textSelectHandle">?android:attr/textSelectHandle</item>
</style>
<style
name="Widget.TextView.ListSeparator.White">
<item
name="android:textColor">?textColorPrimaryInverse</item>
<item
name="android:background">@android:drawable/light_header_dither</item>
</style>
但Eclipse只能链接到Widget.TextView这一层。
可能的原因是要不sdk没有这个style或者是这个style被设置为不公开的了。
对于非public的xml属性,可以在“@”后加个"*"解决,如下:
<item name="android:windowTitleStyle">@*android:style/Widget.TextView.ListSeparator.White</item>
或者有一个比较笨的方法,就是把源码里的那个style复制过来放到自己的xml里然后引用。
相关文章推荐
- JAVA集合框架
- CppUTest不太适合用来做C语言的单元测试
- 《挑战程序设计竞赛》2.3.2 动态规划-优化递推 POJ1742 3046 3181
- COCOS学习笔记--Cocos引擎渲染流程
- Spring Cloud Eureka Server 启停状态监控
- 《挑战程序设计竞赛》2.3 动态规划-优化递推 POJ1742 3046 3181
- 利用.htaccess绑定子域名到子目录(亲测万网可用)
- 一篇文章教你搞懂javaScript原型链
- web开发跨域问题个人总结(PHP与js交互)
- 武林三国将领介绍
- 蓝桥杯之杨辉三角
- ASP.NET中的Session怎么正确使用[转]
- Theano权重子集更新
- XML基础知识
- c#_使用官方驱动操作mongodb数据库
- 学习了一下JAVA
- Hdu 2094之解题报告
- 武林三国游戏记录-武林三国兵种属性总览
- Oracle的REGEXP_SUBSTR函数简单用法
- 魅族实时消息推送架构