且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

以编程方式更改iOS中的启动画面?

更新时间:2023-01-26 10:49:28

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

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.