I recently blogged about Android’s super fancy new BottomNavigationView, and how easy it was to get started with them in your Xamarin.Android application.
I also went through a lot of color customizations that developers can blend in to really make their BottomNavigationView stand out. While this new bottom navigation is awesome, it is also still brand new with a lot of features locked behind internals and hidden fields, which is very sad. Recently I was asked about how to disable the “ShiftMode” of the icons on the bottom when more than 3 sections were added. I first had to go try it for myself to see what they were talking about and sure enough there it was:
Yup, that is no good at all. I actually remember this from the first version of the Google I/O app and they scrambled to turn it off.
If you are using Android Support 28 Libraries then you are in luck because Google now introduced an API to handle this called LabelVisibilityMode. Simply set this property:
If you are no older version of the support libraries then you can still turn off shifting, but it takes a little effor. The functionality exists to turn on and off shifting, but it is a protected field. Luckily, you can use reflection to get to it:
And here you go!
I have also updated my sample on GitHub with this code in it too!
Update February 20th, 2019: Added Support 28 Information