Android &引用;“隐藏的”;工具栏在状态栏下可见
向下滚动时,使用协调器布局隐藏我的工具栏 工具栏认为它是隐藏的-但它不是。 有人知道为什么会这样吗Android &引用;“隐藏的”;工具栏在状态栏下可见,android,android-layout,material-design,androiddesignsupport,Android,Android Layout,Material Design,Androiddesignsupport,向下滚动时,使用协调器布局隐藏我的工具栏 工具栏认为它是隐藏的-但它不是。 有人知道为什么会这样吗 注意:我将状态栏设置为半透明,以便有适当的材质抽屉。将状态栏设置为纯色并不是我想要的解决方案——当然,除非这是我打算使用的方法。不太确定我做错了什么,但我通过以下示例解决了这个问题: 我尝试将状态栏颜色设置为primarydark,当抽屉打开时状态栏不能透明,否则工具栏会再次出现。 经过两天的工作,我发现如果我删除我的协调布局中的android:fitsystemwindows=“true”,
注意:我将状态栏设置为半透明,以便有适当的材质抽屉。将状态栏设置为纯色并不是我想要的解决方案——当然,除非这是我打算使用的方法。不太确定我做错了什么,但我通过以下示例解决了这个问题:
我尝试将状态栏颜色设置为primarydark,当抽屉打开时状态栏不能透明,否则工具栏会再次出现。 经过两天的工作,我发现如果我删除
我的协调布局中的android:fitsystemwindows=“true”
,问题就解决了
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<-- CoordinatorLayout is root of @layout/app_bar_home-->
<include
layout="@layout/app_bar_home"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_home"
app:menu="@menu/activity_home_drawer" />
查看奶酪方代码已经有一段时间了;如果我将android:statusBarColor设置为透明,仍然存在问题。使用折叠工具栏布局包装工具栏可以隐藏工具栏,但是如果我没有任何要与之一起使用的功能图像,该怎么办?