//1.通过UIImageView设置 self.view.insertSubview(UIImageView.init(image: UIImage.init(named: "123")), at: 0) //2.通过layer的content self.view.layer.contents = UIImage.init(named: "123")?.cgImage self.view.contentMode = UIViewContentMode.scaleToFill
本文共 321 字,大约阅读时间需要 1 分钟。
//1.通过UIImageView设置 self.view.insertSubview(UIImageView.init(image: UIImage.init(named: "123")), at: 0) //2.通过layer的content self.view.layer.contents = UIImage.init(named: "123")?.cgImage self.view.contentMode = UIViewContentMode.scaleToFill
转载于:https://my.oschina.net/wayzhu/blog/1571541