Swift - 设置UIImageView圆角无效解决方法

Q:圆角死活不出现

lazy var icon:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "imageName.png")
view.layer.cornerRadius = 15

view.clipsToBounds = true //A:调用控件的clipsToBounds为true即可

return view
}()

你可能感兴趣的:(Swift - 设置UIImageView圆角无效解决方法)