New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationPage.SetHasNavigationBar false doesn't work inside MasterDetailPage #1437

Closed
davidortinau opened this Issue Dec 20, 2017 · 19 comments

Comments

Projects
6 participants
@davidortinau
Contributor

davidortinau commented Dec 20, 2017

Migrated from https://bugzilla.xamarin.com/show_bug.cgi?id=51509

Steps to Reproduce

Page masterContent = new ContentPage() { Title = "Master", BackgroundColor = Color.Red };
Page detailContent = new ContentPage() { BackgroundColor = Color.Blue };

NavigationPage.SetHasNavigationBar(detailContent, false);

MasterDetailPage masterDetail = new MasterDetailPage()
{
	Master = masterContent,
	Detail = new NavigationPage(detailContent)
};

MainPage = masterDetail;

Expected Behavior

NavigatonBar shouldn't be visible.

Actual Behavior

NavigatonBar is visible.

Basic Information

  • Version with issue: 2.3.4

Reproduction Link

https://github.com/jkastner/XamFormsBugSample_51509

@davidortinau davidortinau added this to Ready in v3.0.0 via automation Dec 20, 2017

@pauldipietro pauldipietro added this to New in Triage Dec 20, 2017

@rmarinho rmarinho moved this from New to Ready For Work in Triage Dec 21, 2017

@rmarinho rmarinho moved this from Ready to In Progress in v3.0.0 Jan 9, 2018

@rmarinho rmarinho self-assigned this Jan 9, 2018

@rmarinho rmarinho added the s/invalid label Jan 10, 2018

@rmarinho

This comment has been minimized.

Member

rmarinho commented Jan 10, 2018

This is fixed on the latests

@rmarinho rmarinho closed this Jan 10, 2018

Triage automation moved this from Ready For Work to Invalid Jan 10, 2018

v3.0.0 automation moved this from In Progress to Done Jan 10, 2018

@ikerhg

This comment has been minimized.

ikerhg commented Jan 10, 2018

Hi,

We have updated to the latest version of Xamarin Forms (2.5.0.122203) but we still have the same error with the navigation bar.

We have set:

NavigationPage.SetHasNavigationBar(detailContent, false);

But same error.

image

Is there any other property to set?

Thank you.

Regards,
Iker

@rmarinho

This comment has been minimized.

Member

rmarinho commented Jan 10, 2018

@ikerhg can you upload a test case i used this one here https://github.com/jkastner/XamFormsBugSample_51509 and this works fine

@ikerhg

This comment has been minimized.

ikerhg commented Jan 10, 2018

Hi @rmarinho ,

We are trying to use a custom bar and open menu (so we need popover) when clicking a custom button in our bar. So we need to hide default from the start. This custom bar is only a stacklayout located in the top of the page with a button.

If we set Title to empty string and navigation bar to false in "BrowseEntriesPage.xaml" we still continue seeing the menu bar:

2629eda3

d9bb0348

Is there any way to hide the navigation bar always and show popover menu when clicking a button.

Thank you very much.

Regards,
Iker

@ikerhg

This comment has been minimized.

ikerhg commented Jan 10, 2018

Hi again @rmarinho ,

If we downgrade Xamarin.Forms to 2.3.2.127, it is working as we want, navigation bar is hidden from the begining and we can show popover menu when we want:

217c7096

46d37b9f

Thank you.

Regards,
Iker

@rmarinho

This comment has been minimized.

Member

rmarinho commented Jan 10, 2018

Please upload a short sample so we can look at it.

Thanks

@ibonsanvicente

This comment has been minimized.

ibonsanvicente commented Jan 10, 2018

Hi @rmarinho,

I've tested this. You can check with your own project:

Change BrowseEntriesPage xaml from this:

ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="Browse Entries Page"
BackgroundColor="DarkGray"
x:Class="Test_NavPage.BrowseEntriesPage"

to this:

ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title=""
NavigationPage.HasNavigationBar="False"

BackgroundColor="DarkGray"
x:Class="Test_NavPage.BrowseEntriesPage"

When you launch the project you'll see how the top bar appears with empty title.

But if you downgrade Xamarin.Forms to the last working version before the bug appeared (2.3.2.127), with the same code (you'll only need to remove or change a couple of BackgroundColor properties) the top bar won't appear (as expected since we are setting it that way).

Do you need me to upload your project with doengraded Xamarin version and those changes in BrowseEntriesPage?

@ibonsanvicente

This comment has been minimized.

ibonsanvicente commented Jan 10, 2018

Hi again @rmarinho,

Here you have the downgraded (working) version. Check how the bar does not appear on first page with this Xamarin Forms version.

I haven't added any custom bar or means to show menu, it is not necessary dor the bug reproduction proposal.

XamFormsBugSample_51509-master-2.3.2.127.zip

@ibonsanvicente

This comment has been minimized.

ibonsanvicente commented Jan 11, 2018

Hi @rmarinho,

Shouldn't this bug be reopened?

Thanks,
Ibon

@DennisWelu

This comment has been minimized.

DennisWelu commented Jan 11, 2018

I can confirm I still see this in our UWP app with the very latest Xamarin Forms update.

@rmarinho

This comment has been minimized.

Member

rmarinho commented Jan 11, 2018

@ibonsanvicente this bug is about not being able to hide the bar, but seems your are complaining the oposite. that it doesn't show the bar?!

@rmarinho

This comment has been minimized.

Member

rmarinho commented Jan 11, 2018

Oh ok this is 2.3.2 .. gotcha.

@DennisWelu

This comment has been minimized.

DennisWelu commented Jan 11, 2018

Just a reminder of more background where this came from: https://bugzilla.xamarin.com/show_bug.cgi?id=51509. It is an issue in UWP where the bar does not hide but it should be hidden. It seems to hide properly after toggling the master view on/off.

@rmarinho

This comment has been minimized.

Member

rmarinho commented Jan 12, 2018

@ibonsanvicente seems this only happens when using MasterBehavior="Popover" right?

@DennisWelu @ikerhg are you using Popover too ?

@rmarinho rmarinho reopened this Jan 12, 2018

Triage automation moved this from Invalid to Reopened Jan 12, 2018

v3.0.0 automation moved this from Done to In Progress Jan 12, 2018

@rmarinho rmarinho removed the s/invalid label Jan 12, 2018

@ibonsanvicente

This comment has been minimized.

ibonsanvicente commented Jan 12, 2018

Hi @rmarinho,

Seems so: in our project we use Popover. If I change to Default then the bar does not appear, though Popover is the menu behaviour we need.

Cheers,
Ibon

@DennisWelu

This comment has been minimized.

DennisWelu commented Jan 12, 2018

@rmarinho Yes true, Popover is what we are using as well.

@rmarinho rmarinho moved this from Reopened to Ready For Work in Triage Feb 15, 2018

@rmarinho rmarinho moved this from In Progress to Done in v3.0.0 Mar 15, 2018

@rmarinho rmarinho closed this in 659870c Mar 15, 2018

Triage automation moved this from Ready For Work to Closed Mar 15, 2018

@samhouts samhouts removed this from Closed in Triage Jun 12, 2018

@DennisWelu

This comment has been minimized.

DennisWelu commented Jul 18, 2018

Behavior has changed but...anyone else still not seeing it all work right? My MasterDetailPage.MasterBehavior is set to MasterBehavior.Popover...but with XF 3.1 out of the box for me SetHasNavigationBar(..., false) is still leaving a blank space at the top. Then if I toggle the popover menu open/closed the space at the top goes away and is now replaced by a space at the bottom. (The bottom space showing up is new behavior from previous... ) Almost as if the page content layout was not redone but it shifts up the height of the removed bar...

@charlesroddie

This comment has been minimized.

charlesroddie commented Nov 13, 2018

This is not working for me in the latest XF 3.3.0.967583 . @rmarinho can you reopen pls?

let w  = MainWindowV()
let np = NavigationPage(w)
do  NavigationPage.SetHasNavigationBar(np, false)
do  base.MainPage <-
        MasterDetailPage(Master = ContentPage(Title = "Master"), Detail = np, MasterBehavior = MasterBehavior.Popover)

image

Also, it's odd that to remove the bar we need to wrap a ContentPage in a NavigationPage. Better to have a property on MasterDetailPage instead.

@ibonsanvicente

This comment has been minimized.

ibonsanvicente commented Nov 13, 2018

Same behaviour for us with XF 3.3.0.967583

screenshot_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment