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

寵の児 提交于 2019-12-23 04:46:06

问题


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

Does anyone know how to remove or hide this?

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

Thanks in advance!

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}`);
        }
      }

回答1:


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.



来源:https://stackoverflow.com/questions/46019747/how-to-remove-uwp-cordova-ionic-title-bar-arrow-and-perhaps-app-title

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!