简体   繁体   中英

Xamarin.Forms Android keeping the hamburger/menu icon instead of the Back button

Is there a way to keep the hamburger/menu icon in Xamarin.Forms Android while using a Flyout Navigation and the navigation stack enabled? I use a custom renderer on iOS to have the Back button and the Menu button there but Android would only need the Menu button because the system already has a back button. Any hint or help would be really helpful because I can't find anything relevant on Google.

Okay, I found a way to work around this, it works for now even if it is not the cleanest way:

if (Device.RuntimePlatform != Device.iOS)
{
    FormsApp.GetCurrentNavigationPage().Pushed += (sender, e) =>
    {
        NavigationPage.SetHasBackButton(e.Page, false);
    };
}

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