1

I am having issues with the white flash in Cordova 3.0 for iOS 7 after the splash screen. In the terminal I ran:

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git

My resulting config.xml file was as follows:

    <content src="./index.html" />
<feature name="LocalStorage">
    <param name="ios-package" value="CDVLocalStorage" />
</feature>
<access origin="*" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="UIWebViewBounce" value="true" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="EnableLocation" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="OpenAllWhitelistURLsInWebView" value="false" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />
<feature name="SplashScreen">
    <param name="ios-package" value="CDVSplashScreen" />
</feature>
<feature name="SplashScreen">
    <param name="android-package" value="org.apache.cordova.SplashScreen" />
</feature>
<feature name="InAppBrowser">
    <param name="ios-package" value="CDVInAppBrowser" />
</feature>
<feature name="InAppBrowser">
    <param name="android-package" value="org.apache.cordova.InAppBrowser" />
</feature>

I have the appropriate launch images in the Asset Catalog. Whenever I try to run this app, it always runs fine on the splash screen, but then quickly fades to white. It is so maddening; I've looked at so many links and have done what they've told me, such as:

Phonegap 3 white flash after splash

What am I doing wrong?

UPDATE:

Wow, Phonegap. Here is the solution:

<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen"/>
<param name="onload" value="true" />
</feature>
Community
  • 1
  • 1
Someone
  • 372
  • 1
  • 2
  • 13
  • 3
    Does your app load after the white screen or it hangs there? – benka Oct 24 '13 at 06:51
  • It loads. There may or may not be something wrong with config.xml though, because if I turn off auto hiding the splash screen, it doesn't work. Config.xml is in my platforms/ios/www folder. – Someone Oct 24 '13 at 18:55
  • did that onload = true setting sort your issue? I'm glad if it did :) – benka Oct 25 '13 at 09:21

1 Answers1

1

It is kind of a normal behavior. The Splash screen hides before your app (let's say:index.html) loads.

You can avoid the white flash by delaying the splashscreen.hide() by doing the following:

Edit AutoHideSplashScreen setting in your config.xml file. It has to be false.
(this file should be in the platforms/ios/www/)

<preference name="auto-hide-splash-screen" value="false" />

To delay hiding the splash screen add a timer in the deviceready handler like this (i added it in index.html):

function onDeviceReady() {
    setTimeout(function() {
        navigator.splashscreen.hide();
    }, 2000);
}

This will delay hiding the SplashScreen by 2 seconds. For me it works with 1200 milliseconds, you can experiment with it.

Check out the iOS quirks section:
http://docs.phonegap.com/en/3.0.0rc1/cordova_splashscreen_splashscreen.md.html#splashscreen.hide

benka
  • 4,732
  • 35
  • 47
  • 58
  • 1
    `auto-hide-splash-screen` preference is deprecated since it is not mentioned in [PhoneGap Config XML](https://build.phonegap.com/docs/config-xml) – TasDiam Dec 08 '13 at 20:42