1.定义一个图片
2.将图片转为颜色
3.设置背景颜色
let backgroundImage = UIImage(named: "bg.png")
let backgroundColor = UIColor(patternImage: backgroundImage!)
self.view.backgroundColor = backgroundColor
1.定义一个图片
2.将图片转为颜色
3.设置背景颜色
let backgroundImage = UIImage(named: "bg.png")
let backgroundColor = UIColor(patternImage: backgroundImage!)
self.view.backgroundColor = backgroundColor
本文标题:Swift图片平铺
本文链接:https://www.haomeiwen.com/subject/mrjevttx.html
网友评论