把 UIView 编程一张图片
2016-12-27 本文已影响10人
小猪圣骑士
UIGraphicsBeginImageContext(currentView.bounds.size);
[currentView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);