-(UIImage*)convertViewToImage:(UIView*)v{ UIGraphicsBeginImageContext(v.bounds.size); [v.layerrenderInContext:UIGraphicsGetCurrentContext()]; UIImage*image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); returnimage; }
-(UIImage*)convertViewToImage:(UIView*)v{ UIGraphicsBeginImageContext(v.bounds.size); [v.layerrenderInContext:UIGraphicsGetCurrentContext()]; UIImage*image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); returnimage; }
转载于:https://my.oschina.net/amoyai/blog/91768