Forum Xamarin.Forms

What is the difference between TabBar and TabbedPage?

What is the difference between TabBar and TabbedPage?
What should I use as bottom navigation?

Tagged:

Posts

  • galactosegalactose Member ✭✭

    Hi,

    TabBar is part of TabbedPage. A TabbedPage is a page which allows you to switch between tabs, and these tabs appear in a TabBar.

    Note that the TabBar is not a direct object of the TabbedPage : you cannot access the TabBar to directly set its position. But if can set it according to the platform with specific access, like this on Android :

    using Xamarin.Forms.Xaml;
    using Xamarin.Forms.PlatformConfiguration;
    using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
    
    namespace YourApp.Namespace
    {
        [XamlCompilation(XamlCompilationOptions.Compile)]
        public partial class YourTabbedPage : Xamarin.Forms.TabbedPage
        {
            public YourTabbedPage()
            {
                On<Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
    
                InitializeComponent();
            }
        }
    }
    
Sign In or Register to comment.