簡體   English   中英

Cordova IOS 應用程序在 IOS 14 中顯示白屏

[英]Cordova IOS app shows white screen in IOS 14

Cordova IOS 應用程序在 IOS 14 中顯示白屏。但應用程序在 IOS 14 版本以下運行。 我將我的 Xcode 更新到了 12.0 版。 Cordova IOS平台版本為6.1.0。 Cordova 版本是 10.0.0。 以下是 config.xml 文件中的插件詳細信息和首選項。

<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
</platform>

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

<plugin name="cordova-plugin-network-information" spec="^2.0.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-splashscreen" spec="^6.0.0" />
<plugin name="cordova-plugin-inappbrowser" spec="^4.0.0" />

<preference name="auto-hide-splash-screen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="0" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="2000" />
<preference name="FadeSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="AllowInlineMediaPlayback" value="true" />
<preference name="orientation" value="portrait" />
<preference name="DisallowOverscroll" value="true" />

我嘗試刪除除白名單之外的所有插件。 我刪除了與閃屏相關的首選項並嘗試了它。 靜止應用程序顯示白屏。

請幫我。 任何幫助都應該受到贊賞。 提前致謝。

我找到了答案。

我卸載了閃屏插件。 默認啟動畫面在 Cordova IOS 平台 6.1.0 中可用。

在項目根文件夾中,檢查 res 文件夾。 如果 res 文件夾不可用,我們必須創建一個像“res/screen/ios/”這樣的 res 文件夾路徑,並在 ios 文件夾中上傳啟動畫面圖像。

然后在你的 config.xml 添加這個

<splash src="res/screen/ios/screen-ipad-landscape-2x.png" />
<splash src="res/screen/ios/screen-ipad-landscape.png" />
<splash src="res/screen/ios/screen-ipad-portrait-2x.png" />
<splash src="res/screen/ios/screen-ipad-portrait.png" />
<splash src="res/screen/ios/screen-iphone-landscape-2x.png" />
<splash src="res/screen/ios/screen-iphone-landscape.png" />
<splash src="res/screen/ios/screen-iphone-portrait-2x.png" />
<splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" />
<splash src="res/screen/ios/screen-iphone-portrait.png" />

以下是對我有用的編輯過的 config.xml 代碼。

<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
    <allow-intent href="market:*" />
</platform>
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
    
    <splash src="res/screen/ios/screen-ipad-landscape-2x.png" />
    <splash src="res/screen/ios/screen-ipad-landscape.png" />
    <splash src="res/screen/ios/screen-ipad-portrait-2x.png" />
    <splash src="res/screen/ios/screen-ipad-portrait.png" />
    <splash src="res/screen/ios/screen-iphone-landscape-2x.png" />
    <splash src="res/screen/ios/screen-iphone-landscape.png" />
    <splash src="res/screen/ios/screen-iphone-portrait-2x.png" />
    <splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" />
    <splash src="res/screen/ios/screen-iphone-portrait.png" />
</platform>

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
<plugin name="cordova-plugin-network-information" spec="^2.0.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-inappbrowser" spec="^4.0.0" />

干杯。

我降級到cordova-ios@5.1.1。

暫無
暫無

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

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