I want to create a BottomNavigationView Screen like YouTube but I'm facing an issue that view is not displaying like that.
It perfectly works with three bottom menus but when I'm using more than three menus then Its Title is hiding and menus are shifted. I'm not understanding why this happening, I had tried many tricks but not solve the problem.
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?android:attr/windowBackground"
app:menu="@menu/navigation" />
Java Activity:
BottomNavigationView navigation = findViewById(R.id.navigation);
// I had tried this code but not working
// BottomNavigationMenuView menuView = (BottomNavigationMenuView)
// bottomNavigationView.getChildAt(0);
// bottomNavigationView.setAnimation(null);
// for (int i = 0; i < menuView.getChildCount(); i++) {
// BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(i);
// itemView.setShiftingMode(false);
// itemView.setChecked(false);
// }
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
Anyone, please suggest how I can achieve this.