[英]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?有没有办法在使用弹出式导航并启用导航堆栈时在 Xamarin.Forms Android 中保留汉堡包/菜单图标? 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.我在 iOS 上使用自定义渲染器在那里有后退按钮和菜单按钮,但 Android 只需要菜单按钮,因为系统已经有后退按钮。 Any hint or help would be really helpful because I can't find anything relevant on Google.任何提示或帮助都会非常有帮助,因为我在 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);
};
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.