Cordova UWP Desktop - 隐藏后退箭头

Cordova UWP Desktop - hide back arrow

使用 Cordova 我的目标是 Windows 桌面(特别是 Windows 10)。在我的 deviceready 事件中,我有以下代码:

document.addEventListener( "backbutton", function() {
  window.history.back();
}, false );

这连接了 window 左上角的后退箭头,效果很好。但是,我想隐藏第一个屏幕的箭头。有没有办法根据我当前所在的页面有条件地隐藏后退箭头?

However, I would like to hide the arrow for the first screen. Is there a way to conditionally hide the back arrow based on the page I'm currently on?

在您的应用程序的任何页面上,您可以调用以下 API 再次隐藏后退按钮:

var Core = Windows.UI.Core;
Core.SystemNavigationManager.getForCurrentView().appViewBackButtonVisibility = Core.AppViewBackButtonVisibility.collapsed;