So I have a screen that renders when the app is on the recents screen. But the issue is, it is on the top left and I can't align it to the center and also I couldn’t set the background to white. The white background has to cover the screen and this image should be in middle. So far, I have managed to add the image. but no luck after that. Any help would be appreciated.
override func applicationWillResignActive(_ application: UIApplication) {
if let view = self.window.rootViewController?.view.subviews.first(where: {$0.tag == TAG_BLUR_VIEW}){
view.removeFromSuperview()
blurView = nil
}
if blurView == nil{
blurView = UIImageView(image: UIImage(named: "splash.jpg"))
blurView?.backgroundColor = UIColor .white
blurView?.tag = TAG_BLUR_VIEW
}
self.window.rootViewController?.view.insertSubview(blurView!, at: 0)
}
question from:https://stackoverflow.com/questions/66049407/center-image-and-add-background-in-swift