【发布时间】:2015-07-24 01:42:51
【问题描述】:
在尝试保存视图时遇到了一个奇怪的问题。 保存的图片裁剪掉了图片。
这里是代码:
let scale = UIScreen.mainScreen().scale
let size:CGSize = CGSize(width: CGFloat(self.customView!.frame.size.width), height: CGFloat(self.customView!.frame.size.height))
UIGraphicsBeginImageContextWithOptions( size, false, scale);
self.customView!.layer.renderInContext(UIGraphicsGetCurrentContext())
let screenshot = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
UIImageWriteToSavedPhotosAlbum(screenshot, nil, nil, nil)
请帮忙! 提前致谢
【问题讨论】:
标签: ios swift xcode6.3 save-image