There is recyclerview and the easiest list in it. 14 items are transferred to the adapter, from 1 to 14.

Logs say that everything is displayed. So, the toolbar overlaps the first item in the list. To see this, I made another activation with a similar layout, there is a textView for a match_parent in which there is text in the upper left corner.

This text is not visible including. I attach the layout:

 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/coordinator" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" /> </android.support.design.widget.AppBarLayout> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/fragment_list_container"> </FrameLayout> </android.support.design.widget.CoordinatorLayout> 

And yes, the list in the snippet is:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/fragment_list_container"> </android.support.v7.widget.RecyclerView> </RelativeLayout> 

enter image description here

  • When adding the app:layout_behavior="@string/appbar_scrolling_view_behavior" to the FrameLayout will anything change? - post_zeew
  • @post_zeew yes - it helped. When you write the answer, you can describe in more detail what it is, what it is responsible for, how to use? - Silento
  • I will try. (4 characters) - post_zeew

1 answer 1

To the FrameLayout add the attribute app:layout_behavior :

 app:layout_behavior="@string/appbar_scrolling_view_behavior" 

The app:layout_behavior used by the parent component, CoordinatorLayout to manage interactions between views.

In this case, the value for the "@string/appbar_scrolling_view_behavior" attribute of the app:layout_behavior component of the app:layout_behavior component creates a dependency between the FrameLayout and AppBarLayout and, in particular, indicates that FrameLayout should be located under AppBarLayout .