peterc
peterc

Reputation: 7863

How to remove UWP Cordova (Ionic) title bar arrow, and perhaps app title?

I have a Cordova (Ionic 2) application running on Windows 10 (UWP), I am using Visual Studio 2017 to build the Cordova project.

The hosting window as an arrow, which looks completely out of place, especially if when I am in child views and the Ionic status bar already has a back arrow.

Here the arrow I am talking about

enter image description here

How can I remove or hide this?

Also maybe the application title (though this is not as big an issue).

As suggested by @Sunteen Wu - MSFT, the following solved my problem...

     private hideWindowsTitleBackArrow() : void {
        try {
          let w : any = window;
          if (w.cordova.platformId == "windows") {
              let currentView = w.Windows.UI.Core.SystemNavigationManager.getForCurrentView();
              currentView.appViewBackButtonVisibility = w.Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
          }      
        } catch (error) {
           this.logger.error(`Error in hideWindowsTitleBackArrow: ${error}`);
        }
      }

Upvotes: 0

Views: 412

Answers (1)

Sunteen Wu
Sunteen Wu

Reputation: 10627

You can try to use the following codes in cordova to disable the back button:

if (cordova.platformId = "windows")
{
    var currentView = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
    currentView.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
}

More details please reference SystemNavigationManager class.

Upvotes: 1

Related Questions