记录第一次发布博客,开启自己的iOS笔记人生。
往后转载,借鉴一些大神的好文会注明出处,勿喷。
iOS截取view
- (UIImage )viewSnapshot:(UIView )view
{
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
image = [UIImage imageWithCGImage:CGImageCreateWithImageInRect(image.CGImage,view.bounds)];
return image;
}