简体   繁体   English

Xamarin.Forms Android 保留汉堡包/菜单图标而不是后退按钮

[英]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.

相关问题 更改汉堡菜单图标 - Xamarin.Forms Android & UWP - Change hamburger menu icon - Xamarin.Forms Android & UWP Xamarin Forms Master Details页面将后退按钮更改为汉堡菜单 - Xamarin Forms Master Details Page change back button to hamburger menu 我可以在Xamarin.Forms的Android 4.4上为汉堡包图标设置填充吗? - Can I set a padding to the hamburger icon on Android 4.4 from Xamarin.Forms? 转到 xamarin.forms 中的另一个页面后,汉堡图标消失 - Hamburger icon disappears after going to another page in xamarin.forms Xamarin.Forms 在 Android 状态栏或导航栏后面放置汉堡菜单 - Xamarin.Forms Position Hamburger menu behind Android Status Bar or Navigation Bar Xamarin.forms android Prism 处理硬件后退按钮 - Xamarin.forms android Prism handle hardware back button 如何在Android xamarin.forms中单击按钮打开幻灯片菜单? - how to open slide menu on button click in android xamarin.forms? 在Xamarin.Forms Android应用程序中,先按设备的“后退”按钮,然后按应用程序图标,然后再次调用MainActivity.OnCreate? - In Xamarin.Forms Android app the MainActivity.OnCreate is called again after pressing the device Back button then app icon? Xamarin.Forms:如何在Android上禁用向汉堡包过渡的箭头动画? - Xamarin.Forms: how to disable arrow to hamburger transition animation on Android? Xamarin.Forms:覆盖后退按钮和 OnOptionsItemSelected - Xamarin.Forms: Overriding back button and OnOptionsItemSelected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM