LinearLayout overlapping Support CoordinatorLayout

Try nesting your content inside of a NestedScrollView. Don't forget to include the layout_behavior XML tag.

 <android.support.v4.widget.NestedScrollView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         app:layout_behavior="@string/appbar_scrolling_view_behavior">

     <!-- Your scrolling content -->

 </android.support.v4.widget.NestedScrollView>

Additional resources: http://developer.android.com/reference/android/support/design/widget/AppBarLayout.html


I found a solution. I suppose it's not be the best solution out there, but it makes everything looks OK and it allow us to continue with CoordinatorLayout's animations.

I just set the Fragment's margintTop and marginBot to the exact same DPs that the toolbar on top has and that the bottom nav bar has.

In my case, my toolbar and my navbar have "?attr/actionBarSize" height. So I just set the top and bot margins of my fragment to "?attr/actionBarSize"

Again, it's not as good as using Linear or Relative Layout, but I'm afraid if we chose that solution we waste CoordinatorLayout's animations.

on Toolbar and BottomNavBar:

android:layout_height="?attr/actionBarSize"

and in my Fragment:

android:layout_marginTop="?attr/actionBarSize"
android:layout_marginBottom="?attr/actionBarSize"