简体   繁体   English

Cordova 7.1.0:iOS上启动后出现白屏

[英]Cordova 7.1.0 : White screen after splash on iOS

Specs : 眼镜 :

  • Cordova : 7.1.0 科尔多瓦:7.1.0
  • iOs version : ~4.5.3 iOs版本:〜4.5.3

Source : Hide splash manually 来源: 手动隐藏飞溅

As per the Cordova docs, I've tried adding <preference name="AutoHideSplashScreen" value="false" /> to my config.xml and calling hide manually in the apps onDeviceReady function 根据Cordova文档,我尝试将<preference name="AutoHideSplashScreen" value="false" />到config.xml中,并在应用程序onDeviceReady函数中手动调用hide

 onDeviceReady: function() {
    app.receivedEvent("deviceready");

    setTimeout(function() {
       navigator.splashscreen.hide();
    });
  }

This does not work, and it leaves my app with a spinner that is always visible. 这不起作用,并且使我的应用程序始终处于可见状态。

I've also added the following to see if there might have been a network issue that was causing the white screen. 我还添加了以下内容,以查看是否可能是导致白屏的网络问题。

<access origin="*" />
<allow-navigation href="*" />

I still get a whitescreen after the splash for all devices I emulate. 飞溅后,我仿真的所有设备仍然出现白屏。


config.xml preferences : config.xml首选项:

... ...

    <preference name="SplashScreenDelay" value="3000" />
    <preference name="SplashScreen" value="splash" />
    <preference name="fullscreen" value="true" />
    <preference name="AllowInlineMediaPlayback" value="true" />
    <preference name="AutoHideSplashScreen" value="false" /> 

... ...

   <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <preference name="orientation" value="all" />
        <preference name="DisallowOverscroll" value="true" />
        <preference name="AutoHideSplashScreen" value="false" />
        <splash src="res/screen/ios/Default@2x~universal~anyany.png" />
        <access origin="*" />
        <allow-navigation href="*" />
    </platform>

Another thing I noticed is that the app completely ignore the <preference name="SplashScreenDelay" value="3000" /> . 我注意到的另一件事是,该应用程序完全忽略了<preference name="SplashScreenDelay" value="3000" /> No matter what value I set it to, the splashscreen is briefly shown then disappears. 无论我将其设置为什么值,闪屏都会短暂显示,然后消失。

Turns out it was because I was using an older version of the cordova splashcreen plugin. 原来是因为我使用的是Cordova Splashcreen插件的旧版本。

I fixed it by 我修好了

  • removing the old plugin : cordova plugin remove "org.apache.cordova.splashscreen" 删除旧插件:cordova插件删除“ org.apache.cordova.splashscreen”
  • added new plugin : cordova plugin add cordova-plugin-splashscreen 添加了新插件:cordova插件添加了cordova-plugin-splashscreen

Also make sure your config.xml file is updated with : 还要确保您的config.xml文件已更新为:

- <plugin name="cordova-plugin-splashscreen" spec="^5.0.3" / > - <plugin name="cordova-plugin-splashscreen" spec="^5.0.3" / >

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM