dewango / BottomNavigationBarXF

Bottom Navigation Bar for Xamarin Forms
MIT License
187 stars 97 forks source link

System.DividedByZeroException on Android if you have 0 Tabs #24

Closed dave2ma closed 7 years ago

dave2ma commented 7 years ago

Only on Android you get a System.DividedByZeroException if you initialize a BottomNavigationBar without an Tab. This can happen, if you, for example, don't want to load any tab before login via a modal. Is This issue known?

dave2ma commented 7 years ago

Fixed That in void SetTabItems() in AndroidRenderer:

if (tabs.Length == 0) return; _bottomBar.SetItems(tabs);

mawarnes commented 7 years ago

Great fix, thanks for adding this code, until it is merged in it might be worth making sure people setup tabs. Sad to say this error caused me a days worth of spinning wheels, but really grateful for the plugin....it looks brilliant on Android