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
}()
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
}()