[英]Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.AppCompat.Light.DarkActionBar'
I'm following the android development tutorials from developers.android.com, and currently I'm trying to style my action bar using the information given here: https://developer.android.com/training/basics/actionbar/styling.html#CustomBackground7 我正在关注来自developers.android.com的android开发教程,目前我正在尝试使用此处给出的信息设置我的操作栏: https : //developer.android.com/training/basics/actionbar/styling。 HTML#CustomBackground7
Here's the code of res/values/themes.xml: 这是res / values / themes.xml的代码:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="@android:style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">@style/MyActionBar</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@android:style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/actionbar_background</item>
<!-- Support library compatibility -->
<item name="background">@drawable/actionbar_background</item>
</style>
</resources>
I see red cross icons beside the "style" opening tags, hovering on which the error message reads: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.AppCompat.Light.DarkActionBar'. 我在“样式”开始标记旁边看到红色十字图标,悬停在错误消息上:错误:检索项目的父项时出错:找不到与给定名称匹配的资源'@android:style / Theme.AppCompat.Light.DarkActionBar ”。
Please help. 请帮忙。 I've been at it since morning and I'm not getting anywhere. 我从早上起就一直在这里,而且我没有到达任何地方。
Try to delete android:
, like this: 尝试删除android:
,像这样:
<style name="CustomActionBarTheme"
parent="@style/Theme.AppCompat.Light.DarkActionBar">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.