白色屏幕闪光后启动图像使用Phonegap [英] White screen flash after launch image using Phonegap
问题描述
加载启动图片后,我在加载应用程序之前得到一个白色屏幕。我使用phonegap与xcode。我希望我的应用程序加载在我的笑容图像,使其遵循ios开发人员指南,并提供一个顺利的发射。我认为这个白色的屏幕是一个webview加载我的应用程序。我想要这个webview清楚。有关此问题的修复程序的任何想法或解决方法?
我试图下面的代码,它没有在我的发射有什么区别。此代码位于我的MainViewController.m
-void(webViewDidFinishLoad:(UIWebView *)theWebView
{
theWebView.backgroundColor = [UIColor clearColor];
theWebView.opaque = NO;
}
我已经研究了很多,但我没有找到解决方案。
问题太多,请尝试以下3个步骤来解决问题:
-
set
AutoHideSplashScreen <
在您的phonegap / cordova plist档案中将
至
CDVMainViewController.m的viewDidLoad方法
self.useSplashScreen = YES;
然后将此代码添加到
onDeviceReady()
方法function onDeviceReady()
{
//做你的事情
cordova.exec(null,null,SplashScreen hide,[]); // On Cordova 1.6。0
}
After loading the launch image, I get a white screen before my application loads. I am using phonegap with xcode. I would like my app to load on my lauch image so that it follows the ios developer guidelines and provides a smooth looking launch. I think this white screen is a webview loading for my application. I would like for this webview to be clear. Any ideas on a fix for this problem or a workaround?
I have attempted the following code and it made no difference on my launch. This code is located in my MainViewController.m
-void (webViewDidFinishLoad:(UIWebView*) theWebView
{
theWebView.backgroundColor = [UIColor clearColor];
theWebView.opaque = NO;
}
I have researched this a lot but I haven't found a solution.
I had faced the same problem too, try these 3 steps which I did to solve the issue:
set
AutoHideSplashScreen
toNO
in your phonegap/cordova plist fileAdd this line to your viewDidLoad method of CDVMainViewController.m
self.useSplashScreen = YES;
Then add this code to
onDeviceReady()
methodfunction onDeviceReady() { // do your thing! cordova.exec(null, null, "SplashScreen", "hide", []); //On Cordova 1.6. 0 }
这篇关于白色屏幕闪光后启动图像使用Phonegap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!