ios 代码截取当前view的图片并保存在ios相册

来源:互联网 发布:知乎 回复评论 编辑:程序博客网 时间:2024/05/22 03:24

UIGraphicsBeginImageContex(imageView.frame.bounds);

[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage*  viewImage=UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

UIImageWriteToSavedPhotosAlbum(viewImage,nil,nil,nil);


原创粉丝点击