iOS App Launch Image After a Kill

前端 未结 5 2138
-上瘾入骨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

    Swift 4.2

    func applicationDidEnterBackground(_ application: UIApplication) {
    
            let imageView = UIImageView(frame: self.window!.bounds)
            imageView.tag = 25
            imageView.image = UIImage(named: )
            UIApplication.shared.keyWindow?.subviews.last?.addSubview(imageView)
    }
    
    func applicationWillEnterForeground(_ application: UIApplication) {
    
            if let imageView : UIImageView = UIApplication.shared.keyWindow?.subviews.last?.viewWithTag(25) as? UIImageView {
                imageView.removeFromSuperview()
            }
    
    }
    

提交回复
热议问题