以编程方式更改iOS中的启动画面? [英] Programmatically change splash screen in iOS?

查看:17
本文介绍了以编程方式更改iOS中的启动画面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试弄清楚如何在 iOS 中更改启动画面(默认 png).

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

据我了解,一开始就向用户展示应用程序的理想方式是让启动图像成为应用程序中 UI 元素的骨架表示(例如:http://h.dropcanvas.com/u90tr/IMG_0388.png).

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.

理想情况下,我想做的是以编程方式更改 applicationDidEnterBackground 中的启动图像,以便在返回应用程序时显示相关的初始屏幕.

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.

非常感谢您的帮助!

推荐答案

你不能这样做,也不应该打扰.启动图像(它不是启动画面!)仅在您的应用程序从头开始启动时使用.如果它刚刚进入后台,操作系统将拍摄自己的快照并在您返回应用程序时使用它.

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.

这篇关于以编程方式更改iOS中的启动画面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆