Search code examples
javascriptangularjscordovavisual-studio-cordova

Cordova UWP Desktop - hide back arrow


Using Cordova I'm targeting Windows Desktop (specifically Windows 10). In my deviceready event, I have the following code:

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

This hooks up the back arrow in the top left hand corner of the window and works a treat. 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?


Solution

  • 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?

    On any page of your application, you can call the following API to hide the back button again:

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