Hello, If you use flyoutpage, you can hide the hamburger button by adding a ToolbarHandler in your android platform folder.
using Google.Android.Material.AppBar;
namespace MauiApp6.Platforms.Android
{
internal class ToolbarHandler : Microsoft.Maui.Handlers.ToolbarHandler
{
protected override void ConnectHandler(MaterialToolbar platformView)
{
Toolbar toolbar=VirtualView as Toolbar;
toolbar.DrawerToggleVisible = false;
(VirtualView as Toolbar).PropertyChanged += ToolbarHandler_PropertyChanged;
base.ConnectHandler(platformView);
}
protected override void DisconnectHandler(MaterialToolbar platformView)
{
(VirtualView as Toolbar).PropertyChanged -= ToolbarHandler_PropertyChanged;
base.DisconnectHandler(platformView);
}
private void ToolbarHandler_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (sender is not Toolbar toolbar || !toolbar.DrawerToggleVisible)
{
return;
}
toolbar.DrawerToggleVisible = false;
}
}
}
Then please register this handler in your MauiProgram.cs.
.
builder
.UseMauiApp<App>()
.ConfigureMauiHandlers(handlers =>
{
#if ANDROID
handlers.AddHandler<Toolbar, MauiApp6.Platforms.Android.ToolbarHandler>();
#endif
})
Best Regards, Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.