Android 操作栏和选项卡未正确显示

Android 操作栏和选项卡未正确显示,android,android-layout,android-studio,android-actionbar,android-xml,Android,Android Layout,Android Studio,Android Actionbar,Android Xml,这就是我的应用程序显示的内容 您可以看到顶部的操作栏和选项卡布局都是白色的。由于某些原因,它们被设置为我的颜色背景色。我希望它们被设置为原色。我该怎么做 这是我的密码: 主要xml布局: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.andro

这就是我的应用程序显示的内容

您可以看到顶部的操作栏和选项卡布局都是白色的。由于某些原因,它们被设置为我的颜色背景色。我希望它们被设置为原色。我该怎么做

这是我的密码:

主要xml布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.mddri_.myeats.main._MainActivity">



<android.support.design.widget.TabLayout
    android:id="@+id/tab_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:tabMode="scrollable"
    android:background="@color/colorPrimary"
    />
<android.support.v4.view.ViewPager
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/tab_layout"/>

清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mddri_.myeats">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <meta-data
        android:name="android.app.searchable"
        android:resource="@xml/searchable" />

    <activity android:name=".main.MainActivity">

    </activity>
    <activity android:name=".viewdatabase.ViewDatabase">
        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/searchable" />
    </activity>
    <activity android:name=".viewmeals.ViewMeals" />
    <activity android:name=".viewkitchen.ViewKitchen" />
    <activity
        android:name=".main._MainActivity"
        android:label="@string/title_activity___main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

风格:

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat"> <!--.Light.DarkActionBar-->
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:background">@color/background</item>
    <item name="android:textColor">@color/textColor</item>
    <item name="android:editTextColor">@color/textColor</item>
    <item name="android:actionBarStyle">@style/ActionBarTheme</item>
</style>
<style name="ActionBarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar">
    <item name="android:background">@color/colorPrimary</item>
</style>

@颜色/原色
@颜色/原色暗
@颜色/颜色重音
@颜色/背景
@颜色/文本颜色
@颜色/文本颜色
@风格/动作巴塞姆
@颜色/原色

颜色:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#C0FF3E</color>
<color name="colorPrimaryDark">#04a314</color>
<color name="colorAccent">#8a9b8c</color>
<color name="textColor">#555555</color>
<color name="background">#fcfcfc</color>
</resources>

#C0FF3E
#04a314
#8a9b8c
#555555
#FCFC

有人能帮我找出我做错了什么吗?我将actionbar和TableAyout的背景色都设置为colorPrimary,但它仍然显示为colorbackground,请尝试检查TableAyout中的
app:theme
,或者
app
中是否有任何背景项,您是否正在使用支持库?如果是这样,你能告诉我你的版面文件夹中是否有
app\u bar\u main.xml
吗?我的版面文件夹中没有
app\u bar\u main.xml
,我很确定我正在使用支持库尝试检查表格中的
app:theme
或者
app
中是否有任何背景项你正在使用支持库?如果是,你能告诉我你的layouts文件夹中是否有
app\u bar\u main.xml
?我的layouts文件夹中没有
app\u bar\u main.xml
,我很确定我正在使用支持库