Reputation: 203
In a MAUI contentpage.xaml you can set Shell.NavBarIsVisible="false" as per the code below. (just showing the key parts of the pages and appshell xaml).
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUI.DetailPage"
Shell.NavBarIsVisible="True"
Shell.TabBarIsVisible="False"
Shell.FlyoutBehavior="Disabled"
Title="Detail Page"
>
...
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MAUI.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MAUI"
>
<!-- home landing page -->
<ShellItem
Title="Home"
Route="Home">
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:HomePage}"
Route="HomePage"
/>
</ShellItem>
<FlyoutItem
FlyoutDisplayOptions="AsMultipleItems">
<Tab Title="Data">
<ShellContent
Title="List"
ContentTemplate="{DataTemplate local:ListPage}"
Route="ListPage" />
</Tab>
<Tab Title="About" >
<ShellContent
Title="About"
ContentTemplate="{DataTemplate local:AboutPage}"
Route="AboutPage" />
</Tab>
</FlyoutItem>
</Shell>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUI.HomePage"
Title="Home Page"
>
...
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUI.ListPage"
Title="List Page"
>
...
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUI.AboutPage"
Title="About">
...
Navigation Sequence
Two basic problems:
If I skip steps 6, 7, 8; I can navigate back and forth between Home page, List Page, and Detail page and the Detail page will always show the flyout, navbar, and tabbar.
After step 11, if I go back to Home Page then everything goes back to step 1 again.
Question: is a Shell setting, set in a content page xaml, global to all application pages, or am I just seeing a bug? is there a different way of showing/hiding Flyout, TabBar, NavBar on a per page basis?
Upvotes: 1
Views: 479
Reputation: 13853
step 5 expecting tabbar to be hidden.
You can try to push pages to the navigation stack when you click ListPage and navigate to DetailPage.
For example:
await Navigation.PushAsync(new DetailsPage());
For more information, check document: NavigationPage.
Upvotes: 0