简体   繁体   中英

Xamarin Forms - Hide Burger Menu

Since the release of XF 3.2, it provided the ability to create your own custom TitleBar. This feature works well but I have a couple of problems that I am hoping someone can help me with.

I am trying to hide the Burger Menu icon, but so far I have not been able to.

I can hide the Back Button by doing the following:

NavigationPage.HasBackButton="False"

This does however still leave a slight vertical bar on the left side of the TitleBar, so if someone knows how to also remove that then great.

I was expecting the same code to also hide the Burger Menu icon but this is still present so I'm hoping someone can help me to remove this.

Alternatively, if anyone knows of a way I can either change the icon (to use my own) or to change the colour of it (as it is always white and I want it to be black), then that would be great.

Cheers...

For anyone using Shell you can hide the hamburger button and implicitly disable the flyout menu using:

  • Globally inside AppShell (or whatever named), also you can change the hamburger icon
<Shell>
...
     FlyoutBehavior="Disabled"
     FlyoutIcon="flyouticon.png"
..
</Shell>
  • Or hide it only in some pages:
<ContentPage>
...
    Shell.FlyoutBehavior="Disabled"
</ContentPage>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM