CoordinatorLayout leaves empty space at the bottom after scrolling CoordinatorLayout leaves empty space at the bottom after scrolling android android

CoordinatorLayout leaves empty space at the bottom after scrolling


I had the same problem and I noticed that every layout with this problem had

android:fitsSystemWindows="true"

on CoordinatorLayout

Removing it fixed my problem everywhere.


Try to add Toolbar inside yours CollapsingToolbarLayout:

 <android.support.design.widget.CollapsingToolbarLayout>            <android.support.v7.widget.Toolbar                android:id="@+id/toolbar"                android:layout_width="match_parent"                android:layout_height="?attr/actionBarSize"                android:minHeight="?attr/actionBarSize"                app:layout_collapseMode="pin"/>...</android.support.design.widget.CollapsingToolbarLayout>

Also try to add

android:minHeight="?attr/actionBarSize"

to Toolbar CollapsingToolbarLayout and AppBarLayout


For navigational flags reasons android:fitsSystemWindows="true" did not meet my needs.

After some playing around I found that adding another CollapsingToolbarLayout with 0dp hieght does the trick.

<android.support.design.widget.CollapsingToolbarLayout    android:layout_width="match_parent"    android:layout_height="0dp"    app:layout_scrollFlags="scroll|snap" />