Hidden toolbar appears in status bar

Using CoordinatorLayout to hide the toolbar when scrolling down.

The toolbar thinks it is hidden - But it is not.

Does anyone understand why this is happening?

enter image description here

Note. I have a status bar so that it is translucent in order to have suitable crates for materials. Creating a solid color status bar is not the solution I am looking for - unless, of course, it is not as intended.

+4
source share
2 answers

primarydark, , . , android:fitsSystemWindows="true" CoordinatorLayout, .

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

+2

Source: https://habr.com/ru/post/1611888/


All Articles