Programmatically change splash screen in iOS?

若如初见. 提交于 2019-11-28 04:37:23

问题


I am currently trying to figure out how to change the splash screen (default png) in iOS.

From what I understand, the ideal way to present an application to the user at the very beginning is to have the launch image a skeletal representation of the UI elements in the app (like this: http://h.dropcanvas.com/u90tr/IMG_0388.png).

Now, in my application, when I switch tabs and go to another app or the home screen, when I return to the application, the splash image is no longer relevant to that particular tab.

Ideally, what I would like to do is programmatically change the launch image in applicationDidEnterBackground so I can present a relevant splash screen when returning to the application.

Many thanks for your help!


回答1:


You can't do this, and shouldn't need to bother. The launch image (it is NOT a splash screen!) is only used when your application is launched from scratch. If its just been into the background, the OS will take its own snapshot and use that when you return to the app.

Your launch image therefore only needs to show a basic representation of your app as it will appear when launched from scratch. If you have a tab bar, it shouldn't show any icons or labels (as they can change with localisation) - literally just the black glossy background, all the way across. In your link, I would lose the bar button item, for example.

If you can't make a representative image, a plain black image (or no image at all) would be best.



来源:https://stackoverflow.com/questions/14114381/programmatically-change-splash-screen-in-ios

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