android - "Hidden"状态栏下可见工具栏

标签 android android-layout material-design androiddesignsupport

向下滚动时使用 CoordinatorLayout 隐藏我的工具栏。

工具栏认为它是隐藏的 - 但它不是。

有人知道为什么会这样吗?

enter image description here

注意:我将状态栏设置为半透明,以便有合适的 Material 抽屉。将状态栏设为纯色不是我正在寻找的解决方案 - 当然,除非这就是它的用途。

最佳答案

我尝试将状态栏颜色设置为primarydark,然后打开抽屉时状态栏不能透明,否则工具栏会再次出现。 经过两天的工作,我发现如果我在 CoordinatorLayout删除 android:fitsSystemWindows="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 - "Hidden"状态栏下可见工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33164337/

相关文章:

android - 混合应用程序能否针对 Windows 平板电脑/Surface

java - 如何搜索工作资料联系人

android - 在 Android 上使用 SoundPool 进行无缝循环?

java - 编辑文本属性不显示日期

android - 当键盘在 android 中弹出时,无论设备和屏幕分辨率如何,我如何改变我的观点?

android - 如何将 .cer 转换为 BKS

android - ScrollView 内的 RelativeLayout 不滚动。我做错了什么?

android - 卡片 View 未显示

css - MDL点击 'mdl-navigation__link'时添加波纹效果

wpf - Material 设计 - Wpf - 文本框 - 更改颜色