簡體   English   中英

Android之前的Lollipop工具欄不起作用

[英]Android pre Lollipop toolbar don't work

我在設備中有一個抽屜菜單,張貼LOLIPOP可以在標題和圖標導航上更改顏色,但是在設備中PRE LOLLIPOP不能正常工作,只能顯示白條,但不顯示圖標

我的工具欄

<FrameLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Users.MenuDrawer">
    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        >

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@color/WHITE"
                app:popupTheme="@style/AppTheme.PopupOverlay"
                android:theme="@style/CustomToolbar" />

        </android.support.design.widget.AppBarLayout>

        <include layout="@layout/content_main" />


    </android.support.design.widget.CoordinatorLayout>
</FrameLayout>

和我的風格

<style name="CustomToolbar" parent="AppTheme">
    <item name="android:textColorSecondary">@color/BLACK</item>
    <item name="colorPrimary">@color/BLACK</item>
    <item name="actionMenuTextColor">@color/BLACK</item>
    <item name="android:textColor">@color/BLACK</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.ActionBar" >
    <item name="android:textColorSecondary">@color/BLACK</item>
    <item name="colorPrimary">@color/BLACK</item>
</style>

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

我的錯誤是在pre lolipop的mi工具欄的z索引位置中使用的框架布局不起作用我添加了此更改並正常工作

<FrameLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Users.MenuDrawer">
    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        >

        <include layout="@layout/content_main" />

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@color/WHITE"
                app:popupTheme="@style/AppTheme.PopupOverlay"
                android:theme="@style/CustomToolbar" />

        </android.support.design.widget.AppBarLayout>




    </android.support.design.widget.CoordinatorLayout>
</FrameLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM