簡體   English   中英

Ionic 在啟動畫面后總是顯示空白屏幕

[英]Ionic always show blank screen after splash screen

我有一個離子項目,所以在我運行這個構建之后

ionic cordova run ios -l --consolelogs --target='2E565780-E17E-4358-8DD0-FFA9681D5F8C'

通常它工作正常,但不知何故現在我得到了錯誤。 觸發啟動畫面后,它總是向我顯示空白屏幕。 我已經把這個 function

ngOnInit() {
        console.log(this.platform);

        this.platform.ready().then(() => {
            if (this.platform.is("cordova")) {
                this.statusBar.styleDefault();
                this.splashScreen.hide();
        });
    }

在 app.component 上,但似乎沒有觸發。 有沒有我錯過的工作? 任何幫助將非常感激。

嘗試添加 function 以從您的 app.component 構造函數執行:

constructor( ... ){
    this.initializeApp();
}

initializeApp(){
    this.platform.ready().then(() => {
        if (this.platform.is("cordova")) {
            this.statusBar.show();
            this.statusBar.styleDefault();
            this.splashScreen.hide();
        }
    });
}

我解決了這個問題,它與我添加的插件有關,所以我嘗試這樣做

  1. 卸載插件
  2. 刪除 ios 文件夾
  3. 全新安裝節點模塊
  4. 添加插件
  5. 添加 ios 文件夾

希望對遇到同樣問題的人有所幫助。

暫無
暫無

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

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