【发布时间】:2018-08-13 00:18:30
【问题描述】:
【问题讨论】:
-
使用图像图形上下文。将三个图像按从后到前的顺序绘制到其中。完成。
标签: swift uiimageview photolibrary
【问题讨论】:
标签: swift uiimageview photolibrary
试试这个,传入包含你需要的所有子视图的基础视图:
func createImage(from aView:UIView) -> UIImage {
UIGraphicsBeginImageContextWithOptions(CGSize(width: aView.frame.width, height: aView.frame.height), true, 0)
aView.layer.render(in: UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image!
}
【讨论】: