Error retrieving parent for item: No resource foun

2019-01-10 20:25发布

I am implementing ActionBar to set the color for text using this style script in xml but getting error when I run my application time does anybody have idea what I have missing

this is my style.xml file

<!-- Start with the Holographic Light theme -->
<style name="Theme.IOSched" parent="android:style/Theme.Holo.Light">
    <item name="android:windowBackground">@drawable/window_background</item>
    <item name="android:actionBarStyle">@style/ActionBar</item>

    <!-- custom attributes 
    <item name="textHeaderMaxLines">@integer/text_header_max_lines</item>
    <item name="trackAbstractMaxLines">@integer/track_abstract_max_lines</item>-->
</style>

<style name="Theme.IOSched.Home" parent="style/Theme.IOSched">
    <item name="android:windowBackground">@drawable/window_background_home</item>
    <item name="android:actionBarStyle">@style/ActionBar</item>
</style>

<style name="ActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@color/actionbar_background</item>
    <item name="android:textColor">@color/accent_1</item>
    <item name="android:titleTextStyle">@style/ActionBarText</item>
</style>

<style name="ActionBarText" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"> <!-- getting here error-->
    <item name="android:textColor">@color/accent_1</item>
    <item name="android:textStyle">bold</item>
</style>

error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Widget.ActionBar.Title'.

7条回答
男人必须洒脱
2楼-- · 2019-01-10 20:30

I tried to change target sdk to 13 but does not works!! then when I changed compileSdkVersion 13 to compileSdkVersion 14 is compiled successfully :)

NOTE: I Work with Android Studio not Eclipse

查看更多
Deceive 欺骗
3楼-- · 2019-01-10 20:31

Make sure you've set your target API (different from the target SDK) in the Project Properties (not the manifest) to be at least 4.0/API 14.

查看更多
欢心
4楼-- · 2019-01-10 20:33

AndroidManifest.xml:

<uses-sdk
    android:minSdkVersion=...
    android:targetSdkVersion="11" />

and

Project Properties -> Project Build Target = 11 or above

These 2 things fixed the problem for me!

查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-10 20:36
<style name="Theme.IOSched" parent="android:style/Theme.Holo.Light">
    <item name="android:windowBackground">@drawable/window_background</item>
    <item name="android:actionBarStyle">@style/ActionBar</item>
</style>

you can not give your own color and backgroud in item windowBackground. give your color in your /color.xml file.

查看更多
老娘就宠你
6楼-- · 2019-01-10 20:39

This happens because in r6 it shows an error when you try to extend private styles.

Refer to this link

查看更多
仙女界的扛把子
7楼-- · 2019-01-10 20:48

TextAppearance.Holo.Widget.ActionBar.Title appears to have been added in API Level 13. Make sure your build target is set to 13, not just 11.

查看更多
登录 后发表回答