Sooraj
Sooraj

Reputation: 133

Creating Bottom Navigation Bar for Android and iOS using Xamarin Forms

Is it possible to create bottom navigation bar for Android and iOS using Xamarin Forms without using Custom renderer.

I heard that the latest Xamarin Forms support bottom Navigation bar feature, but sadly I was not able to find the appropriate documentation.

Need some help / guidelines to implement the same.

Upvotes: 0

Views: 1032

Answers (1)

Shailendra Kumar
Shailendra Kumar

Reputation: 168

I am sharing My Application code, hope it will help you.

XML Page :

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="iSAS.Mobile.Views.Student.SettingsPage"
         Title="Profile" 
         xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
         BarBackgroundColor="White"
         BarTextColor="#2196F3" 
         android:TabbedPage.ToolbarPlacement="Bottom"
         android:TabbedPage.BarItemColor="#66FFFFFF"
         android:TabbedPage.BarSelectedItemColor="#2196F3" >
 </TabbedPage>

CS Page :

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SettingsPage : TabbedPage
{
    public SettingsPage()
    {
        InitializeComponent();
        Children.Add(new ProfilePage());
        Children.Add(new ChangePassword());
        Children[0].Icon = "profile.png";
        Children[1].Icon = "settings.png";

        CurrentPage = Children[1];
    }

    public SettingsPage(bool DefaultChangePswdPage = true)
    {
        InitializeComponent();
        Children.Add(new ProfilePage());
        Children.Add(new ChangePassword());
        Children[0].Icon = "profile.png";

        Children[1].Icon = "settings.png";
        if (DefaultChangePswdPage)
            CurrentPage = Children[1];
    }
}

Upvotes: 1

Related Questions