How to I hide Tabs?
In my opinion you should not.
For the navigation scheme you described, tabbed pages are not at all the right means, neither technically, nor from a UX perspective.
Maybe the easiest way to achieve the desired navigation scheme will be to use a NavigationPage
(see here and here) and hide the navigation bar by setting the HasNavigationBar
property to false
// in App.xaml.cs
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new FirstPage())
{
HasNavigationBar = false;
};
}
From your pages you can access Application.Current
, get the NavigationPage
and navigate
public void Button_OnPress(object sender, EventArgs e)
{
var navigationPage = Application.Current.MainPage as NavigationPage;
if(navigationPage != null)
{
navigationPage.PushAsync(new WhatEverPage());
}
}
Remarks: Though you can do it that way, it doesn't mean you should. I'd strongly suggest to use a MVVM-framework like Prism and navigate with prisms INavigationService
. This way you keep your pages loosely coupled, since INavigationService
does not takes instances of pages, but their names and resolves them with a DI container.