I have a problem when I try to place fragments using CoordinatorLayout + AppBarLayout .
I try to load various fragments into my RelativeLayout content, which is below the ActionBar with the app:layout_behavior="@string/appbar_scrolling_view_behavior" attribute app:layout_behavior="@string/appbar_scrolling_view_behavior" , but when I load a fragment with two buttons at the bottom of the screen, they are loaded from the screen.
The content in which the fragments are loaded comes out of the screen, and the content always comes out of the bottom.
This code of my main_activity.xml :
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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/coordinator" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".views.activities.HomeActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/appBarLayout" android:layout_height="wrap_content" android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay" > <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" app:layout_scrollFlags="scroll|enterAlways" /> </android.support.design.widget.AppBarLayout> <RelativeLayout android:id="@+id/containerLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" > </RelativeLayout> </android.support.design.widget.CoordinatorLayout>
This is a screenshot with off-screen content.

This is a screenshot of a fragment where I have a problem: 
This is a screenshot with a fragment loaded into the emulator. You can see how the bottom buttons are not displayed. They are hidden in the navigation bar:

How can I prevent this problem?
EDIT
<android.support.design.widget.CoordinatorLayout 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/coordinator" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".views.activities.HomeActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/appBarLayout" android:layout_height="wrap_content" android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay" > <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" app:layout_scrollFlags="scroll|enterAlways" /> </android.support.design.widget.AppBarLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <FrameLayout android:id="@+id/containerLayout" android:layout_width="match_parent" android:layout_height="match_parent"> </FrameLayout> </RelativeLayout> </android.support.design.widget.CoordinatorLayout>
EDIT 2: I tried putting the ToolBar in a RelativeLayout, but it works partially. Now animation on actionBar does not work when scrolling in recyclerView
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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/coordinator" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".views.activities.HomeActivity"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" > <android.support.design.widget.AppBarLayout android:id="@+id/appBarLayout" android:layout_height="wrap_content" android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay" android:layout_alignParentTop="true"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" app:layout_scrollFlags="scroll|enterAlways" /> </android.support.design.widget.AppBarLayout> <FrameLayout android:id="@+id/containerLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/appBarLayout"> </FrameLayout> </RelativeLayout> </android.support.design.widget.CoordinatorLayout>