ios view截图

- (UIImage *)cutFromView:(UIView *)view
{
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0.0);
    [view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return img;
}

 

posted on 2015-06-23 17:18  airy99  阅读(194)  评论(0编辑  收藏  举报