错误检索父项:未发现的资源匹配给定名称“@android:风格/ TextAppearance.Holo.Widget.ActionBar.Title”风格、错误、名称、发现

2023-09-12 03:10:27 作者:撩妹课代

我在执行动作条使用这种风格的脚本XML,但得到的错误,当我运行我的应用程序时,没有任何人有想法,我已经失踪设置文本的颜色

这是我的style.xml文件

 <! - 先从全息光主题 - >
<样式名称=Theme.IOSched父=机器人:款式/ Theme.Holo.Light>
    <项目名称=机器人:windowBackground> @可绘制/ window_background< /项目>
    <项目名称=机器人:actionBarStyle> @风格/动作条< /项目>

    <! - 自定义属性
    <项目名称=textHeaderMaxLines> @整数/ text_header_max_lines< /项目>
    <项目名称=trackAbstractMaxLines> @整数/ track_abstract_max_lines< /项目>  - >
< /风格>

<样式名称=Theme.IOSched.Home父=风格/ Theme.IOSched>
    <项目名称=机器人:windowBackground> @可绘制/ window_background_home< /项目>
    <项目名称=机器人:actionBarStyle> @风格/动作条< /项目>
< /风格>

<样式名称=动作条父=机器人:款式/ Widget.Holo.Light.ActionBar>
    <项目名称=机器人:背景> @色/ actionbar_background< /项目>
    <项目名称=机器人:文字颜色> @色/ accent_1< /项目>
    <项目名称=机器人:titleTextStyle> @风格/ ActionBarText< /项目>
< /风格>

<样式名称=ActionBarText父=@安卓风格/ TextAppearance.Holo.Widget.ActionBar.Title> <! - 到达这里的错误 - >
    <项目名称=机器人:文字颜色> @色/ accent_1< /项目>
    <项目名称=机器人:TEXTSTYLE>大胆< /项目>
< /风格>

错误:错误检索父项:未发现的资源匹配给定名称@android:风格/ TextAppearance.Holo.Widget.ActionBar.Title。
 

解决方案

TextAppearance.Holo.Widget.ActionBar.Title 似乎在API级别13制作添加确保您的构建目标设置为13,而不是11。

这些年 崛起 的Android技术博主们

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

解决方案

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.