且构网

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

iOS应用程序启动图像后杀死

更新时间:2023-01-26 10:58:20

要强制iOS启动带有默认图像的应用,请致电 [[UIApplication sharedApplication] ignoreSnapshotOnNextApplicationLaunch]; 您实施状态保存的位置。

To force iOS to launch an app with its default image, call [[UIApplication sharedApplication] ignoreSnapshotOnNextApplicationLaunch]; where you implement state preservation.

来自文档


当你的应用程序重新启动是
,系统会显示此快照图像以代替您的
应用程序的默认启动图像,以保留您的应用仍为
仍在运行的概念。如果您觉得快照无法在重新启动应用程序时正确反映应用程序用户界面的
,则可以调用
此方法以防止拍摄快照图像。如果您是
,UIKit会使用您应用的默认启动图片。

When your app is relaunched, the system displays this snapshot image in place of your app’s default launch image to preserve the notion that your app was still running. If you feel that the snapshot cannot correctly reflect your app’s user interface when your app is relaunched, you can call this method to prevent that snapshot image from being taken. If you do, UIKit uses your app’s default launch image instead.

另请参阅这个问题了解更多详情。

Also look at this question for more details.