Cordova 3.4 iOS白屏后飞溅 [英] Cordova 3.4 iOS white screen after splash

查看:690
本文介绍了Cordova 3.4 iOS白屏后飞溅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的启动屏幕加载并显示〜2之后,我在这里关于这个问题的几个不同的帖子,秒,有一个白色屏幕显示约2秒,然后应用程序内容显示。



这个问题只存在于iOS上,只有当我运行模拟器3.5与iOS 6.1和7。



我有

  name =AutoHideSplashScreenvalue =false/> 

screen隐藏在deviceready事件中:

  function onDeviceReady(){
setTimeout(function(){navigator。 splashscreen.hide()},2000);
//更多的东西
}



Sooo..what是什么意思?

$ p

解决方案

我有同样的问题(Cordova 3.4),但我在这里解决了。



这似乎是CDVSplashScreen 中的某种错误。请注意它在输出中如何表示找不到图像默认纵向。 (应该正在寻找另一个文件默认,而不是默认纵向。)



:找不到名为Default-Portrait的启动画面图片





  • 创建名为 Default-Portrait @ 2x〜iphone的新闪屏。 png Default@2x~iphone.png 的副本),并将其添加到资源下的splash目录中。 (如果你需要支持iOS 6,你可能还需要一个 Default-Portrait〜iphone.png 文件。)不要重命名文件,或


  • 确保此新文件位于项目列表中。 (我没有重建项目与 cordova build ios 所以我不得不把文件从finder到Xcode中的项目文件不知道重建是否自动添加到您的Xcode项目。)




这应该可以解决你的问题。



我刚刚切换到Xcode 5.1和iOS 7.1和Cordova有一些问题,新的SDK以及。如果你绊倒一些问题与Xcode 5.1& iOS 7.1,我也想链接到以下页面


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?

解决方案

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.

这篇关于Cordova 3.4 iOS白屏后飞溅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆