简体   繁体   English

飞溅后的Cordova 3.4 iOS白屏

[英]Cordova 3.4 iOS white screen after splash

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. 在我的启动画面加载并显示约2秒后,会出现一个白色屏幕,显示约2秒钟,然后显示应用程序内容。

This issue only exists on iOS and only when I run the emulator on 3.5" with iOS 6.1 and 7. 此问题仅存在于iOS上,并且仅在我使用iOS 6.1和7在3.5“上运行模拟器时才存在。

I have 我有

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

so I can manually control when the splash screen hides in the deviceready event as such: 所以我可以手动控制启动屏幕何时隐藏在deviceready事件中:

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. 我看到完全相同的行为,除了加载微调器在2000年后消失。

Sooo..what the heck is going on? 那么......到底是怎么回事?

I have the same problem (Cordova 3.4), but I solved it here. 我有同样的问题(Cordova 3.4),但我在这里解决了。

It seems to be some kind of bug in CDVSplashScreen . 它似乎是CDVSplashScreen中的某种错误。 Notice how it says in the Output that it couldn't find the image "Default-Portrait". 注意它在输出中如何说它找不到图像“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. 创建一个新的名为闪屏Default-Portrait@2x~iphone.png (复印件Default@2x~iphone.png ),并把它添加到下资源飞溅目录。 (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. (如果你需要支持iOS 6,你可能也需要一个Default-Portrait~iphone.png文件。) 不要只是重命名文件,否则Xcode可能因为文件丢失而无法构建你的项目。

  • 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.) (我没有使用cordova build ios重建项目,因此我不得不将文件从finder拖到Xcode中的项目文件中。不确定重建是否会自动将其添加到Xcode项目中。)

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. 我刚刚切换到Xcode 5.1和iOS 7.1,而Cordova也遇到了新SDK的一些问题。 If you stumble upon some issues with Xcode 5.1 & iOS 7.1, I would also like to link you to the following page . 如果您偶然发现Xcode 5.1和iOS 7.1的一些问题,我还想将您链接到以下页面

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

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