iOS App Launch Image After a Kill

前端 未结 5 2187
-上瘾入骨i
-上瘾入骨i 2021-02-09 06:16

When I kill my iPhone app and relaunch it I have an image of the app\'s previous state instead of the launch image. How can I force iOS to always show the launch image?

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-09 06:36

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

    From the documentation:

    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.

提交回复
热议问题