Bug 41480 - SetHasNavigationBar(this, false) Fails on NavigationPages
Summary: SetHasNavigationBar(this, false) Fails on NavigationPages
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.0
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-03 13:03 UTC by mwg@thoughts.net
Modified: 2016-08-09 17:22 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Repro (181.67 KB, application/zip)
2016-08-08 22:36 UTC, adrianknight89
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description mwg@thoughts.net 2016-06-03 13:03:09 UTC
In a Cross-platform Xamarin Forms project, and although effective on the MainPage, use of SetHasNavigationBar(this, false) on NavigationPages created from MainPage is not effective on all platforms. On WinPhone, a black space is allocated at the top of the screen. On iPhone, the NavigationBar is present. On Nexus9/6 emulators (VS2015v2), the NavigationBar is not present(FUNCTIONAL).
Comment 1 adrianknight89 2016-07-17 01:31:12 UTC
i have this issue as well
Comment 2 Rui Marinho 2016-08-08 14:38:06 UTC
Thank you for taking the time to submit the bug.

If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.

For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d Warm regards, Xamarin Forms Team
Comment 3 adrianknight89 2016-08-08 22:36:39 UTC
Created attachment 16951 [details]
Repro

Here's a repro. I'm hiding the navigation bar in Page1's constructor. In Page2's constructor, the same line of code is commented out. If you click Page1's button, Page2 will be loaded but the navigation bar appears again.

If you want to hide the navigation bar, then NavigationPage.SetHasNavigationBar(this, false); must be called on all pages.
Comment 4 Rui Marinho 2016-08-09 10:42:20 UTC
Hi, i looked at the issue and what you are expecting is not correct. 

This works as an attached property on a page, and the extension method takes the page you want to hide the nav on, this will only work for pages that aren't navigation pages, (but children of it).
Comment 5 adrianknight89 2016-08-09 14:44:03 UTC
ok, so you're saying that the nav bar should be hidden for each page separately? i was under the impression that it was a global toggle switch basically.
Comment 6 Rui Marinho 2016-08-09 17:22:02 UTC
Yes you have to set for each page separately.