![](/img/trans.png)
[英]Android Studio App don't work on Lollipop or KitKat only on 6.0
[英]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.