White screen flash after starting the image using Phonegap

After loading the launch image, I get a white screen before downloading the application. I am using phonegap with xcode. I would like my application to download my lauch image so that it follows the recommendations of the ios developers and ensures a smooth launch. I think this white screen is loading a web browser for my application. I would like this webview to be clear. Any ideas on fixing this problem or workaround?

I tried to execute the following code, and it didn't make any difference when I ran it. This code is in my MainViewController.m

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

I researched this a lot, but I did not find a solution.

+5
source share
6 answers

, 3 , , :

  • AutoHideSplashScreen NO pls phonegap/cordova

  • viewDidLoad CDVMainViewController.m

    self.useSplashScreen = YES;
    
  • onDeviceReady()

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

ModalViewController, "Default.png" , UIWebView UIActivityIndicator, , . - , .

, .

+2

, , , ?

window.setTimeout(function() { 
navigator.splashscreen.hide();
},1350);

AutoHideSplashScreen pls phonegap/cordova

+2

. , , . , uiwebview, . . ( .)

0

Cordova/Phonegap 3+, config.xml:

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

:

cordova plugin add org.apache.cordova.splashscreen

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
  // depending on how many things you are rendering on your webview, you might want to add an artificial wait
  var SPLASH_SCREEN_DELAY = 500;
  setTimeout(function() {
    navigator.splashscreen.hide();
  }, SPLASH_SCREEN_DELAY);
}
0

, , , .css .js.

To overcome this problem, we can use the screensaver and also delay its time, so that before the download of all the necessary files, the end user will not see the nameless nameless screen, instead our custom screensaver will be displayed.

I solved this by referring to the first and second part of the answer given by "ian". These are the steps that I followed.

Step 1: Install the Splashscreen Cordova plugin.

cordova plugin add org.apache.cordova.splashscreen

Step 2. Set the Auto Hide Splash Screen parameter from the config.xml file to false.

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

Step 3: Increase Screen Saver Delay Time

<preference name="SplashScreenDelay" value="6000"/>

Hope this helps someone :)

0
source

All Articles