Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正在尝试设置android actionbar 2.1版(API 7)及以上版本的背景_Android_Android Layout_Android Actionbar - Fatal编程技术网

正在尝试设置android actionbar 2.1版(API 7)及以上版本的背景

正在尝试设置android actionbar 2.1版(API 7)及以上版本的背景,android,android-layout,android-actionbar,Android,Android Layout,Android Actionbar,好吧,我一直在尝试设计我的动作条,但它似乎不起作用 themes.xml <resources> <!-- the theme applied to the application or activity --> <style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <

好吧,我一直在尝试设计我的动作条,但它似乎不起作用

themes.xml

<resources>
    <!-- the theme applied to the application or activity -->
    <style 
        name="CustomActionBarTheme"
        parent="@style/Theme.AppCompat.Light.DarkActionBar">

        <!-- Support library compatibility -->
        <item name="actionBarStyle">@style/MyActionBar</item>
    </style>

    <!-- ActionBar styles -->
    <style 
        name="MyActionBar"
        parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">

        <!-- Support library compatibility -->
        <item name="background">@drawable/actionbar_background</item>
    </style>
</resources>
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/CustomActionBarTheme" >

@样式/MyActionBar
@可绘制/操作栏\u背景
manifest.xml

<resources>
    <!-- the theme applied to the application or activity -->
    <style 
        name="CustomActionBarTheme"
        parent="@style/Theme.AppCompat.Light.DarkActionBar">

        <!-- Support library compatibility -->
        <item name="actionBarStyle">@style/MyActionBar</item>
    </style>

    <!-- ActionBar styles -->
    <style 
        name="MyActionBar"
        parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">

        <!-- Support library compatibility -->
        <item name="background">@drawable/actionbar_background</item>
    </style>
</resources>
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/CustomActionBarTheme" >


我确保在正确的文件夹中有actionbar_background.png(基本上是一个带颜色的正方形图像)。然而。当我运行up时,我仍然看到旧的操作栏,好像没有任何变化。

不是缓存,我只是尝试在不同的设备上运行它,一个虚拟设备都显示了旧的操作栏。这里回答:谢谢,这是解决方案