Allowing more than 3 menus

suggest change

This example is strictly a workaround since, currently there is no way to disable a behaviour known as ShiftMode.

Create a function as such.

public static void disableMenuShiftMode(BottomNavigationView view) {
    BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
    try {
        Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode");
        shiftingMode.setBoolean(menuView, false);
        for (int i = 0; i < menuView.getChildCount(); i++) {
            BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);
            //noinspection RestrictedApi
            // set once again checked value, so view will be updated
            //noinspection RestrictedApi
    } catch (NoSuchFieldException e) {
        Log.e("BNVHelper", "Unable to get shift mode field", e);
    } catch (IllegalAccessException e) {
        Log.e("BNVHelper", "Unable to change value of shift mode", e);

This disables the Shifting behaviour of the menu when item count exceeds 3 nos.


BottomNavigationView navView = (BottomNavigationView) findViewById(;

Proguard Issue : Add following line proguard configuration file as well else, this wouldn’t work.

-keepclassmembers class { 
boolean mShiftingMode; 

Alternatively, you can create a Class and access this method from there. See Original Reply Here

NOTE : This is a Reflection based HOTFIX, please update this once Google’s support library is updated with a direct function call.

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents