问题
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...
回答1:
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>
来源:https://stackoverflow.com/questions/53340478/xamarin-forms-hide-burger-menu