首页 > drawViewHierarchyInRect 在iphone6 plus(ios 8.2上崩溃)

drawViewHierarchyInRect 在iphone6 plus(ios 8.2上崩溃)

class func imageWithView(view : UIView) -> UIImage {

UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0)
view.drawViewHierarchyInRect(view.bounds, afterScreenUpdates: true)
let img = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return img

}

在iphone6 plus 上 执行此函数 会发生以下错误 cause EXC_BAD_ACCESS on “drawViewHierarchyInRect”. 在Iphone6-Plus 模拟器上会返回一张全透明的图.在 Iphone5 Iphone6 上 可以执行。。。。有人有解决办法吗

【热门文章】
【热门文章】