+ (UIImage *)clearImageView { UIColor *color=[UIColor clearColor]; CGRect rect =CGRectMake(0,0,64,64); UIGraphicsBeginImageContext(rect.size); CGContextRef context =UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [color CGColor]); CGContextFillRect(context, rect); UIImage *image =UIGraphicsGetImageFromCurrentImageContext(); return image; }
原文:https://www.cnblogs.com/cchHers/p/12297602.html