xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

When NavigationPage is used without a Navigation Bar, blank bar appears after a PushModalAsync/PopModalAsync #15346

Open vsfeedback opened 2 years ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] We don't use the shell in our apps. Instead, we do our own Navigation management via NavigationPage class:

public App()
{
    InitializeComponent();

    MainPage = new NavigationPage(new MainPage());//new AppShell();
}

In the MainPage constructor, we hide the NavigationBar before the call to InitializeComponent:

If we subsequently PushModalAsync to push a page, then PopModalAsync to pop the page, the MainPage now has a blank bar (presumably the NavigationBar at the top).


Original Comments

Feedback Bot on 5/1/2022, 08:37 PM:

(private comment, text removed)


Original Solutions

(no solutions)

LuckyGolfer commented 2 years ago

As a workaround, I am able to do the following in the MainPage OnAppearing event: NavigationPage.SetHasNavigationBar(this, true); // this'll hide the title NavigationPage.SetHasNavigationBar(this, false); // this'll hide the title

jfversluis commented 2 years ago

Hey there, thanks for the report! What platform are we talking about here? :)

LuckyGolfer commented 2 years ago

Platform I have been working on is Windows (since I can't run on Android due to TLS Handshake error when using Winsock). Also, I see this has been put in the Xamarin.Forms bucket, but I'm trying to work with .Net Maui so not sure it got put in the right bucket.