样式 TextAppearance.Holo 未找到
我构建这个应用程序已经有一段时间了,在我今天更新到最新的平台工具之前,主题没有遇到任何问题。现在它告诉我
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium.Inverse'.
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium'.
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Large'.
这是我的 styles.xml 中导致问题的部分,但正如我所说,它几个月来都没有改变,直到今天都工作正常!
<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Holo.Light.Medium.Inverse">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BD.TextAppearance.Medium" parent="@android:style/TextAppearance.Holo.Light.Medium">
<item name="android:textColor">#666666</item>
<item name="android:textSize">16sp</item>
</style>
<style name="BD.TextAppearance.Large" parent="@android:style/TextAppearance.Holo.Light.Large">
<item name="android:textColor">#666666</item>
<item name="android:textSize">20sp</item>
</style>
-=编辑=- 我开始摆弄这些值,结果发现它确实找到了这些样式:
<style name="BD.TextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Medium.Inverse">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
但不是这些:
<style name="BD.TextAppearance" parent="@android:style/TextAppearance.Holo">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Light.Medium.Inverse">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
I have been building this app for a while now and have not had any trouble with the themes until I updated to the latest platform tools today. Now it's telling me
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium.Inverse'.
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium'.
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Large'.
This is the part of my styles.xml that is causing the problem but, as I said, it hasn't changed in months and worked fine until today!
<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Holo.Light.Medium.Inverse">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BD.TextAppearance.Medium" parent="@android:style/TextAppearance.Holo.Light.Medium">
<item name="android:textColor">#666666</item>
<item name="android:textSize">16sp</item>
</style>
<style name="BD.TextAppearance.Large" parent="@android:style/TextAppearance.Holo.Light.Large">
<item name="android:textColor">#666666</item>
<item name="android:textSize">20sp</item>
</style>
-= EDIT =-
I started messing around with the values and it turns out that it does find these styles:
<style name="BD.TextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Medium.Inverse">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
But not these:
<style name="BD.TextAppearance" parent="@android:style/TextAppearance.Holo">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Light.Medium.Inverse">
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">bold</item>
</style>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我仍然不知道为什么会发生这种情况,但我已经找到了解决方法。我从 Android SDK 复制了 styles.xml 文件并将其粘贴到我的项目中,并取出了所有未使用的样式。我更改了所有“父”声明以包含“@android:”前缀,并在“?”之后添加了“android:”对于所有属性。这允许它编译和运行。但就像我说的,我真的很想找出它首先破裂的原因!
I still don't know why this happened but I have found a way around it. I copied the styles.xml file from the Android SDK and pasted it into my project and took out all of the styles that I wasn't using. The I changed all of the 'parent' declarations to include the '@android:' prefix and added 'android:' after the '?' for all attributes. This allows it to compile and run. But like I said I would really like to find out why it broke in the first place!
我也面临同样的问题,我所做的只是删除了
parent="@android:style/TextAppearance.Holo.Light.Medium.Inverse"
属性。检查一下它会起作用。I too face the Same problem what i did is that just i removed the
parent="@android:style/TextAppearance.Holo.Light.Medium.Inverse"
attribute. It will works check it.