方法如下:
let topView = UIView()
let bjViewImage = UIImage.init(named: "bg_shang")
// 设置 topView 的背景图片
topView.layer.contents = bjViewImage?.CGImage
方法如下:
let topView = UIView()
let bjViewImage = UIImage.init(named: "bg_shang")
// 设置 topView 的背景图片
topView.layer.contents = bjViewImage?.CGImage