白色屏幕闪光后启动图像使用Phonegap [英] White screen flash after launch image using Phonegap

查看:94
本文介绍了白色屏幕闪光后启动图像使用Phonegap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

加载启动图片后,我在加载应用程序之前得到一个白色屏幕。我使用phonegap与xcode。我希望我的应用程序加载在我的笑容图像,使其遵循ios开发人员指南,并提供一个顺利的发射。我认为这个白色的屏幕是一个webview加载我的应用程序。我想要这个webview清楚。有关此问题的修复程序的任何想法或解决方法?



我试图下面的代码,它没有在我的发射有什么区别。此代码位于我的MainViewController.m

  -void(webViewDidFinishLoad:(UIWebView *)theWebView 
{
theWebView.backgroundColor = [UIColor clearColor];
theWebView.opaque = NO;
}

我已经研究了很多,但我没有找到解决方案。

解决方案

问题太多,请尝试以下3个步骤来解决问题:


  1. set AutoHideSplashScreen <

  2. 在您的phonegap / cordova plist档案中将 CDVMainViewController.m的viewDidLoad方法

      self.useSplashScreen = YES; 


  3. 然后将此代码添加到 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:

  1. set AutoHideSplashScreen to NO in your phonegap/cordova plist file

  2. Add this line to your viewDidLoad method of CDVMainViewController.m

    self.useSplashScreen = YES;
    

  3. Then add this code to onDeviceReady() method

    function onDeviceReady()
    {
    // do your thing!
    cordova.exec(null, null, "SplashScreen", "hide", []);  //On Cordova 1.6. 0
    }
    

这篇关于白色屏幕闪光后启动图像使用Phonegap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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