Phone delay 3 white flash after burst

I know that this has been asked (and answered) several times ( Phone screen showing a white screen after the screen saver - IOS , Phonegap 2.0 - when the application starts, the white screen blinks before loading my application , how to kill the white flickering screen saver at the beginning of the application for a mobile phone iOS? ), but none of these solutions seem to work for me. Maybe because I use Phonegap version 3?

I download only Phonegap and jQuery 2.0.0 (other solutions relate to jQuery-mobile, which I do not use), and I focus only on iOS for deployment. I have downloaded a pop-up image, then the application displays a white screen (the duration varies - I assume it loads the application, maybe?), Then my index.html loads my first screen. Here is my current chapter:

<head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="viewport" content="user-scalable=no, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> <link type="text/css" rel="stylesheet" href="css/main.css" /> <title>My App</title> <script type="text/javascript" src="phonegap.js"></script> <script src="js/lib/jquery-2.0.0.min.js"></script> <script src="js/main.js"></script> </head> 

I tried adding this to my config.xml file (at the same folder level as index.html):

 <preference name="backgroundColor" value="0x000000" /> 

but I still get a white flash. I also tried manually hiding / showing the splash with:

 function onDeviceReady() { navigator.splashscreen.show(); } 

but this did not seem to have any effect. Anyone have any suggestions?

+8
ios cordova
source share
5 answers

Finally, I was able to eliminate the flash burst, but for this I had to use Cordoba. Here are the steps I took:

In terminal:

 cordova create ~/path/to/project "com.appname.app" "appName" cd ~/path/to/project cordova platform add ios cordova build cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git cordova build 

Use Finder to go to ~/path/to/project/platforms/ios/ and double-click projectname.xcodeproj to open the project in Xcode.

Then I went in and edited the images. You could do this in several ways. Here's what I did: In Xcode, go to Resources/splash/ , right-click the image to change, select Show in Finder and use all the tools you want to change.

Once done, go back to Xcode and open the root level of config.xml (you still don't know why there are two config.xml files, but you want one of them to be deleted most in the folder structure). Update the AutoHideSplashScreen property to

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

From the Xcode main menu, select Product > Clean and then Product > Build .

Worked for me repeatedly. Then I was able to use the methods navigator.splashscreen.show() and navigator.splashscreen.hide() from my application (which did not seem to respond without going through all these steps).

Hope this helps!

+18
source share

I have a problem with plugins or a problem with telephone service, therefore

 function onDeviceReady() { navigator.splashscreen.show(); } 

not working for me.

I fixed it by setting webview alpha to 0 before loading:

3 steps:

  • in the file "CDVViewController.m" in the method " -(void)createGapView " I added:
    self.webView.alpha = 0;
  • in the file "MainViewController.m" in the method " -(void)WebViewDidFinishLoad:(UIWebView*)theWebView" I added: theVebView.alpha=1;
  • in the file "MainController.xib" I changed the background to black (set it to whatever color you prefer).

Now, instead of a white screen flash, I have black until the content is fully loaded. enough for me. (although not perfect)

hope this helps.

+4
source share

try adding

<param name="onload" value="true" /> to the SplashScreen function in config.xml.

+1
source share

This worked for me using build.phonegap.com

Step 1: added Slashscreen plugin to your config.xml

 <gap:plugin name="org.apache.cordova.splashscreen" version="0.2.7" /> 

Step 2. Update your config.xml with this preference.

 <preference name="auto-hide-splash-screen" value="false" /> 

Step 3: added a call to the plugin function on the event 'deviceready'

 <script> document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { navigator.splashscreen.hide() } </script> 
0
source share

After I got angry with the splash plugin, I recognize this solution:

  • in MainViewController.xib, add a UIImageView (imgView).
  • put your splash image in it, set the scale to fill.
  • In MainViewController.m, override - (void) webViewDidFinishLoad: (UIWebView *) theWebView
  • add this code after [super webViewDidFinishLoad: theWebView];

    [self.view sendSubviewToBack: imgView];

    imgView.hidden = YES;

0
source share

All Articles