Pregunta

I have been looking around at a few different posts on here concerning this issue and nothing has solved my problem.

After my splash screen loads and displays for ~2 seconds there is a white screen that shows for about 2 seconds and then the app content displays.

This issue only exists on iOS and only when I run the emulator on 3.5" with iOS 6.1 and 7.

I have

<preference name="AutoHideSplashScreen" value="false" /> 

so I can manually control when the splash screen hides in the deviceready event as such:

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

The problem is that this doesn't stop splashscreen from hiding prematurely. I see the exact same behavior except the loading spinner does disappear after 2000.

Sooo..what the heck is going on?

¿Fue útil?

Solución

I have the same problem (Cordova 3.4), but I solved it here.

It seems to be some kind of bug in CDVSplashScreen. Notice how it says in the Output that it couldn't find the image "Default-Portrait". (It should be looking for another file, "Default", not "Default-Portrait".)

WARNING: The splashscreen image named Default-Portrait was not found

What I did was the following:

  • Create a new splash screen named Default-Portrait@2x~iphone.png (a copy of Default@2x~iphone.png) and add it to the splash directory under Resources. (If you need to support iOS 6 you'll probably need a Default-Portrait~iphone.png file as well.) Don't just rename the file, or Xcode might not build your project due to a missing file.

  • Ensure that you also make sure that this new file is in your project list. (I didn't rebuild the project with cordova build ios so I had to drag the file from finder to the project files in Xcode. Not sure if rebuilding automatically adds it to your Xcode project.)

This should solve your problem.

I just switched to Xcode 5.1 and iOS 7.1 and Cordova has some issues with the new SDK as well. If you stumble upon some issues with Xcode 5.1 & iOS 7.1, I would also like to link you to the following page.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top