ios中将view转为image

来源:互联网 发布:yield python 编辑:程序博客网 时间:2024/04/29 00:59
- (UIImage*) imageWithUIView:(UIView*) view{    UIGraphicsBeginImageContext(view.bounds.size);    CGContextRef ctx = UIGraphicsGetCurrentContext();    [view.layer renderInContext:ctx];    UIImage* tImage = UIGraphicsGetImageFromCurrentImageContext();    UIGraphicsEndImageContext();    return tImage;}


0 0
原创粉丝点击