【问题标题】:Cordova iOS Splash Screen stays waaay too longCordova iOS 启动画面停留时间太长
【发布时间】:2017-03-02 02:27:19
【问题描述】:

所以,我正在为我的 Cordova iOS 应用程序使用“启动画面”。我实际上使用的是“LaunchStoryBoard”图像。我的问题是它似乎在最终被解雇之前停留了很长时间。稳定的 3 秒(如 1 密西西比州等)。

我查看了 stackoverflow,但很多响应似乎是针对 Ionic 框架/Android 的。我不使用那个。直接使用 iOS 的 Cordova。

这是我的 config.xml:

 <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <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/Default@2x~universal~anyany.png" />
    </platform>

在我的应用程序的“常规设置”中,我将“启动屏幕文件”设置为 CDVLaunchScreen。

再次,它工作正常,只是停留时间过长。把它剃掉 1 秒就太好了。

另外,如果您有任何自定义 javascript 提示/帮助,请告诉我应该放入哪个文件(例如 index.js)。

提前致谢。

【问题讨论】:

  • 是整个 config.xml 吗?还有其他插件吗?

标签: ios cordova splash-screen


【解决方案1】:

两种方法。

  1. 您可以尝试使用 cordova splash screen plugin 并使用 SplashScreenDelay 首选项来设置您选择的延迟。
  2. 您可以使用启动画面插件,将AutoHideSplashScreen 首选项设置为false,然后您可以在索引页面的onload 中使用此代码来隐藏启动画面:

    navigator.splashscreen.hide();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-17
    • 1970-01-01
    • 2017-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多