I\'m using BottomNavigationView with using Android Support Desing Library 25. But when I switch the tabs, the other tab\'s title is hiding. But there is no hiding issue actu
This works for me in API 26 :
navigation = (BottomNavigationView) view.findViewById(R.id.bottom_navigation);
try{disableShiftMode(navigation);}catch(Exception ew){}
Make this method in your Activity or Fragment where you want to call:
@SuppressLint("RestrictedApi")
public static void disableShiftMode(BottomNavigationView view) {
BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
try {
Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode");
shiftingMode.setAccessible(true);
shiftingMode.setBoolean(menuView, false);
shiftingMode.setAccessible(false);
for (int i = 0; i < menuView.getChildCount(); i++) {
BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);
item.setShiftingMode(false);
item.setChecked(item.getItemData().isChecked());
}
} catch (NoSuchFieldException e) {
} catch (IllegalAccessException e) {
}
}