【问题标题】:Error retrieving parent for item:No resource found that matches the given name @style/Theme.Holo检索项目的父项时出错:找不到与给定名称 @style/Theme.Holo 匹配的资源
【发布时间】:2014-01-10 06:49:24
【问题描述】:

这是我的 res/values/themes.xml 中的代码。我的 minSdkVersion 设置为 11。M 收到错误为错误检索项目的父项:找不到与给定名称匹配的资源 @style/Theme.Holo

 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 <!-- the theme applied to the application or activity -->
 <style name="CustomActionBarTheme"
   parent="@style/Theme.Holo">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarTabTextStyle">@style/MyActionBarTabText</item>
<item name="android:actionMenuTextColor">@color/actionbar_text</item>
</style>

<!-- ActionBar styles -->
<style name="MyActionBar"
   parent="@style/Widget.Holo.ActionBar">
<item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
</style>

<!-- ActionBar title text -->
<style name="MyActionBarTitleText"
   parent="@style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@color/actionbar_text</item>
</style>

<!-- ActionBar tabs text styles -->
<style name="MyActionBarTabText"
   parent="@style/Widget.Holo.ActionBar.TabText">
<item name="android:textColor">@color/actionbar_text</item>
</style>
</resources>

【问题讨论】:

标签: android


【解决方案1】:

改变

<style name="CustomActionBarTheme" parent="@style/Theme.Holo">

<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo">

对其他样式资源也这样做...

【讨论】:

  • 我也有同样的问题,我按照这个问题解决了,但是你能解释一下为什么“parent="@style/Theme.Holo" 不起作用,我们需要把它改成“父=”@android:style/Theme.Holo”。非常感谢!
【解决方案2】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-27
    • 2014-06-04
    • 2017-02-10
    • 2017-06-27
    • 2017-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多