Remove the NavigationBar in MAUI

Jassim Al Rahma 1,526 Reputation points
2022-09-03T12:53:33.207+00:00

Hi,

What is the alternative for this in MAUI?

NavigationPage.SetHasNavigationBar(this, false);  
NavigationPage.SetBackButtonTitle(this, null);  

I tried:

Shell.SetNavBarIsVisible(this, false);  

but did not work, although I already have this in my xaml:

xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"  
ios:Page.UseSafeArea="True"  

Thanks,
Jassim

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

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,806 Reputation points Microsoft Vendor
    2022-09-05T05:20:11.587+00:00

    Hello,

    It's the same as Xamarin for hiding NavigatonBar of NavigationPage in MAUI.

    I tried: Shell.SetNavBarIsVisible(this, false); but did not work,

    For a NavigationPage, it is useless to set shell properties.

    You could try to use the following methods to hide it:

    XAML:

       NavigationPage.HasNavigationBar="False"  
       NavigationPage.BackButtonTitle=""  
    

    C#:

       NavigationPage.SetHasNavigationBar(this, false);  
       NavigationPage.SetBackButtonTitle(this, null);  
    

    Best Regards,

    Alec Liu.


    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