Android Bottom Toolbar with Xamarin

I noticed that there are many requests for bottom toolbars on Android with multiple tabs although it is against the design specs for Android.

Because I couldn’t find a good solution I decided to share my own solution for Xamarin here.

The code can be cloned from GitHub:

Here is a short explanation of my solution. Please check the Code for Details. It is fairly simple

  • The Main layout (Resources/layout/Main.axml) has a custom title bar and a custom bottom toolbar in a relative layout. The toolbar buttons are implemented as ImageButtons and the icons are located in the drawable folders. The middle section is a Framelayout that is filled with different fragments for each tab.

  • Each Fragment has its own layout file and is implemented as a Fragment in the Views folder.

  • When the user clicks a button a specific tab is loaded and the content section is filled with the frame layout. See MainActivity.cs for details

The solution can easily be transferred to Android Studio. The layouts stay the same. You just have to rewrite the c sharp code in Java.

I hope this example helps you with your project. Don’t hesitate to ask if you have any questions.

comments powered by Disqus