样式 TextAppearance.Holo 未找到

发布于 2024-12-06 13:35:51 字数 2492 浏览 1 评论 0原文

我构建这个应用程序已经有一段时间了,在我今天更新到最新的平台工具之前,主题没有遇到任何问题。现在它告诉我

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'.

error messages

这是我的 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'.

error messages

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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南七夏 2024-12-13 13:35:51

我仍然不知道为什么会发生这种情况,但我已经找到了解决方法。我从 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!

伪装你 2024-12-13 13:35:51
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium.Inverse'.

我也面临同样的问题,我所做的只是删除了

parent="@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.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文