flyout page titles

Eduardo Gomez Romero 205 Reputation points
2024-04-06T02:28:10.2533333+00:00

Is there a way, to get rid or hide the page title in flyouts

User's image

<Shell
    x:Class="DemyAI.AppShell"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
    xmlns:vm="clr-namespace:DemyAI.ViewModels"
    x:Name="flyout"
    Title="DemyAI"
    x:DataType="vm:AppShellViewModel"
    FlyoutBehavior="{OnIdiom Desktop=Locked,
                             Phone=Flyout}"
    Shell.NavBarIsVisible="{OnIdiom Phone=True,
                                    Desktop=False}"
    Shell.TabBarIsVisible="False">

    <Shell.FlyoutFooterTemplate>
        <DataTemplate>
            <Button
                Margin="20"
                Command="{Binding SignOutCommand}"
                CornerRadius="8"
                Text="Log out" />
        </DataTemplate>
    </Shell.FlyoutFooterTemplate>

</Shell>

In know that I can put "NavBarIsVisible = false" but if I did that I would lose my hamburger icon

Shell.NavBarIsVisible=
Shell.NavBarIsVisible=

"

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,893 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 68,656 Reputation points Microsoft Vendor
    2024-04-08T07:35:09.8633333+00:00

    Hello,

    You can do it by removing the Title property in the `` ShellContentandContentpage`.

    For example, if you have ShellContent like following code. Please remove Title="Home"

     <ShellContent
    Title="Home"
    ContentTemplate="{DataTemplate local:MainPage}"
    Route="MainPage" />
    

    And if you set the title in the ContentPage like following code, please remove Title="DogsPage" as well.

    <?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="MauiGradientTabbar.DogsPage"
    
                 Title="DogsPage">
    
        <VerticalStackLayout>
    
            <Label
    
                Text="DogsPage"
    
                VerticalOptions="Center"
    
                HorizontalOptions="Center" />
    
        </VerticalStackLayout>
    </ContentPage>
    

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful