简体   繁体   中英

Cordova iOS App Getting White Flash between Launch Storyboard and First Screen

I just converted an iOS Cordova app which used the SplashScreen plugin to use a Launch Storyboard so it would support iOS 9 multitasking on iPad. This works, but now I have a white flash between the launch storyboard and the first screen of the app. Before, when I was using the splashscreen plugin, I turned off AutomaticHideSplashScreen and used the splashscreen plugin API to hide it when I would be sure the rendering of the first screen would be finished.

Is there any way to do something similar, or at least delay the disappearance of the launch screen to give the webview time to render?

Adding the launch screen xib view as subview of the rootViewController view should fix this. Just add the following code in application didFinishLaunchingWithOptions method in the AppDelegate.m just above the line that says return YES .

UIViewController * launchScreenView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] objectAtIndex:0];
launchScreenView.view.frame = [[UIScreen mainScreen] bounds];
[self.window.rootViewController.view addSubview:launchScreenView.view];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM