override func viewDidLoad() {
super.viewDidLoad()
// 给一张图片添加一个颜色相框
let image = UIImage(named:"cat")
let imageView = UIImageView(image: image)
imageView.frame = CGRect(x: 24, y: 80, width: 150, height:200)
imageView.layer.borderWidth = 10
imageView.layer.borderColor = UIColor.lightGray.cgColor
self.view.addSubview(imageView)
}
iOS之给图片添加一个颜色相框(Swift4.2)
最新推荐文章于 2021-05-23 15:11:18 发布