Android – hidden toolbar visible under status bar
•
Android
Use coordinatorlayout to hide my toolbar when scrolling down
The toolbar thinks it's hidden - but that's not the case
Who knows why?
Note: I set the status bar to translucent to have the appropriate material drawer. Making the status bar solid is not the solution I'm looking for - unless, of course, it's how I intend to use it
resolvent:
After two days of work, I found that if I deleted Android: fitssystemwindows = "true" in coordinatorlayout, it would be solved
<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" />
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码