簡體   English   中英

Ionic - 使 windows 應用程序以全屏模式運行

[英]Ionic - Make the windows app run at fullscreen

是否可以全屏構建 windows 桌面應用程序? 因為最初當我運行我的應用程序時,大小為 1200x900。

在我的 config.xml 我有這個<preference name="Fullscreen" value="true" />

根據我對cordova-plugin-statusbar研究,我也有這段代碼:

this.platform.ready().then(() => {
  StatusBar.hide();
});

但是我在全屏運行 Windows 的應用程序時運氣不佳。 我找到了一個解決方案,但僅適用於 android:

if (this.platform.is("android")) {
    this.androidFullScreen.isImmersiveModeSupported().then(
      () => this.androidFullScreen.immersiveMode()
    ).catch((error: any) => console.log(error));
}

你可以試試下面的代碼,在page.ts文件中添加

ionViewWillEnter() {
    this.statusBar.overlaysWebView(true);
}// where you want full screen

ionViewWillEnter() {
    this.statusBar.overlaysWebView(true);
}// where you want normal screen

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM