简体   繁体   中英

Add Splash-screen for when App Launches (Even From Multitasking)?

I need to add a short splash-screen to my app, which appears even when the app is launched from multitasking.

I have managed to do so, popping an UIImageView up and fading it out after a couple of seconds form the - (void)applicationWillEnterForeground:(UIApplication *)application method in my app delegate.

However when launching from multitasking, while it appears and works fairly well, sometimes there a short delay before the image pops up and so you briefly see the view behind it.

How can I overcome this?

Thanks.

ok, now I understand -

then you may try to use

 - (void)applicationDidBecomeActive:(UIApplication *)application

If I understand correctly you're just trying to create a launch image right? So in that case you would simply go into your info-plist in Supporting Files then highlight one of the items and press the "+" icon. Select "Launch Image" from the drag down menu, and type the name of your image into the text box next to "Launch Image".

Try this.

Create a reference (a strong reference if using ARC) to the view, so you hold it. Then create the view anywhere in the program really (I guess at first start would be good). Then, when you return from multitasking, you don't need to create a new view (which might take time), you only push the view that you already have set up in-memory.

Assuming you don't do this already, it should significantly shorten (or remove) the delay you're seeing.

Also, don't forget to set animated: to NO

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