dewango / BottomNavigationBarXF

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

How about an actual implementation tutorial? #83

Open christianwico opened 6 years ago

christianwico commented 6 years ago

I've spent weeks and multiple "attempt" projects just trying to implement this thing as I see it in the example with absolutely zero luck. I keep ending up with the default Xamarin.Forms implementation of Android Tabs (top bar).

Would a good tutorial in the README file be too difficult to accomplish?

AlexanderMelchers commented 6 years ago

Hi @christianwico,

Have you switched the inheritance of your tab parent page from a TabbedPage to a BottomBarPage? This is the first prerequisite for the BottomBarPageRenderer to detect it should process your tabbed page, rather than have the default renderer do this.

The second is that, unless you're implementing your own derived BottomBarPageRenderer (for which you, in fact, should then also do this, as for all custom renderers), you should ensure that the assembly containing the BottomBarPageRenderer. This means that you should at least access a type within BottomBar.Droid.Renderers-namespace, even if just to perform a typeof(BottomBar.Droid.Renderers.BottomBarPageRenderer). This will ensure that the assembly containing the type in question gets loaded. Now you can of course defer this type inclusion in any way you like, but the easiest way to include it is to simply include the mentioned typeof-statement in your application's main activity, prior to the call to LoadApplication.

If you do the above two things, my guess is everything should work just fine :)

Good luck!

All the best, Alexander.