简体   繁体   English

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

[英]Android pre Lollipop toolbar don't work

I have a drawer menu in devices post LOLIPOP work fine in change colors on title and icon navigation but in devices PRE LOLLIPOP don't work and only display white bar but dont show icon 我在设备中有一个抽屉菜单,张贴LOLIPOP可以在标题和图标导航上更改颜色,但是在设备中PRE LOLLIPOP不能正常工作,只能显示白条,但不显示图标

my toolbar 我的工具栏

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

and my styles 和我的风格

<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" />

My error is in used frame layouts in z index position to mi toolbar in pre lolipop dont work i added this change and work fine 我的错误是在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.

相关问题 Android Studio App仅在6.0上无法在Lollipop或KitKat上运行 - Android Studio App don't work on Lollipop or KitKat only on 6.0 为什么连接管理器不能在棒棒糖之前的设备上运行? - Why connectivity manager doesn't work on pre-lollipop devices? Pre-Lollipop 和 Lollipop 设备的材料设计颜色不起作用 - Material Design Color for Pre-Lollipop and Lollipop devices doesn't work OnCheckedChangeListener不适用于工具栏中的开关 - OnCheckedChangeListener don't work with a Switch in the Toolbar Android Lollipop 5.0上的工具栏阴影问题 - Toolbar shadow issue on Android lollipop 5.0 带有Lollipop SDK的Android中的工具栏/ ActionBar中的字幕标题? - Marquee title in Toolbar / ActionBar in Android with Lollipop SDK? 我的Android Studio项目在Lollipop上可用,但在Kitkat上不可用 - My Android Studio project works on Lollipop but doesn't work on Kitkat 卡在棒棒糖之前的版本中未在Android 5.0中间隔开 - Cards not spaced in Android 5.0, as they are in pre-lollipop Hibernate JPA实体侦听器@Pre和@Post无法正常工作 - Hibernate JPA Entity listener @Pre and @Post don't work as expected Android应用在Java库Lollipop之前崩溃 - Android app crashes on Java library pre-Lollipop
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM