Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.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 为动作栏的背景设置主题_Android_Android Theme - Fatal编程技术网

Android 为动作栏的背景设置主题

Android 为动作栏的背景设置主题,android,android-theme,Android,Android Theme,我试图简单地改变我的应用程序的ActionBar的背景颜色,但遇到了一些麻烦 以下是我的主屏幕布局: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" an

我试图简单地改变我的应用程序的ActionBar的背景颜色,但遇到了一些麻烦

以下是我的主屏幕布局:

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white_paper"
    tools:context=".HomeActivity">

    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <ListView android:id="@+id/left_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp"
        android:background="@color/impending_doom"/>
</android.support.v4.widget.DrawerLayout>

以下是我的风格:

<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="AppBaseTheme" parent="android:Theme.Light">

    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <item name="android:actionBarStyle">@style/ActionBar</item>
        <item name="android:actionBarTabStyle">@style/ActionBarTab</item>
    </style>

    <style name="ActionBar" parent="@android:style/Widget.ActionBar">
        <item name="android:background">@color/impending_doom</item>
    </style>

    <style name="ActionBarTab">
        <item name="android:background">@color/impending_doom</item>
    </style>
</resources>

@样式/操作栏
@风格/动作BARTAB
@颜色/即将到来的厄运
@颜色/即将到来的厄运
以下是该应用程序目前的外观:


我只想更改ActionBar的背景。为什么我正在做的事情已经不起作用了?

您使用的是常规的ActionBar、compatibility还是ActionBarSherlock?你的目标是什么版本的API?常规的ActionBar,我想我的目标是11-14。它似乎工作得很好。
@color/impressing_doom
的价值是什么?这些样式在哪些文件中?如果您有一个res/values-14/styles.xml,那么将使用它们(或res/values-11/styles.xml)。