- (UIImage*) imageWithUIView:(UIView*) view
{
UIGraphicsBeginImageContext(view.bounds.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[view.layer renderInContext:context];
UIImage* tImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return tImage;
}
注意:此方法不是線程安全的。使用時(shí)需注意!