Introduction
In this article, I have explained the BottomNavigationViewin Xamarin.Android. Bottom navigation bars make it easy for users to explore and switch between top-level views in a single tap. They should be used when an application has three to five top-level destinations.
The bar contents can be populated by specifying a menu resource file. Each menu item title, icon, and enabled state will be used for displaying bottom navigation bar items. Menu items can also be used for programmatically selecting which destination is currently active. It can be done using MenuItem #setChecked(true)
Requirement
Install-Package Xamarin.Google.Android.Material -Version 1.4.0
Step 1
Create the BottomNavigationView design in required XML files like below and define the content page as required.
Step 2
Create the bottom_nav_menu.xml and write the selected tab logic with resource id as below,
Step 3
I have created the two XML fragment pages and navigating with the selected BottomNavigationView defined item id as below,
Step 4
Create the two-fragment page VpnFragment.cs with content resource network_layout and NetworkFragment.cs with content resource vpn_layout as below,
OUTPUT
![]()
Hopefully, this article has given you sufficient information for you to start creating your BottomNavigationView in your Xamarin.Android application. Feel free to leave a comment if you would like me to further elaborate on anything within this article.