美文网首页
把 UIView 编程一张图片

把 UIView 编程一张图片

作者: 小猪圣骑士 | 来源:发表于2016-12-27 10:05 被阅读10次

UIGraphicsBeginImageContext(currentView.bounds.size);

[currentView.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

相关文章

网友评论

      本文标题:把 UIView 编程一张图片

      本文链接:https://www.haomeiwen.com/subject/wjbsvttx.html