how to to kill the white flickering splashscreen at the start of phonegap iOS app?

帅比萌擦擦* 提交于 2019-11-28 01:49:20

问题


How to get rid of the white splashscreen flickering at the start of a phonegap iOS application?


回答1:


You need to go in PhoneGap.plist and set the AutoHideSplashScreen to NO

Then whenever you want in your app you can choose to hide the splashscreen with the following code :

navigator.splashscreen.hide();

Hope this helps




回答2:


You can change the default.png and default@2x.png splash screens to something more of your liking. That gets rid of the white background.

You can find these resources in the appname/appname/Resources/Splash folder in an Xcode 4x project.




回答3:


I have a problem with the plugins or some problem with phonegap so

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

doesn't work for me.

I fixed it by setting the webview alpha to 0 until it's loaded:

3 steps:

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

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

hope this helps..




回答4:


If you have added SplashScreen plugin but navigator.splashscreen is still undefined, you can try:

cordova.exec(null, null, "SplashScreen", "hide", [])


来源:https://stackoverflow.com/questions/6992939/how-to-to-kill-the-white-flickering-splashscreen-at-the-start-of-phonegap-ios-ap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!