I tried the Google BottomNavigationView support library with Framelayout for my snippets.
Here is my code
<?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:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="com.bottombarnavigation.MainActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <include layout="@layout/toolbar"/> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_main" /> <android.support.design.widget.BottomNavigationView android:background="#fcfcfc" android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom|end" app:menu="@menu/bottom_navigation" /> </android.support.design.widget.CoordinatorLayout>
When I populate my Recyclerview inside the Fragment, its contents are closed by the BottomNavigationView.

I have no idea why this is happening. I am looking at other people's textbook and it works great.
EDIT Here is my content_main.xml file
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context="com.bottombarnavigation.MainActivity" tools:showIn="@layout/activity_main"> <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent"></FrameLayout> </RelativeLayout>
android android-support-library bottomnavigationview
abcdaddadddads
source share