+ (UIImage *)createImageWithColor:(UIColor *)color andSize:(CGSize)size { CGRect rect=CGRectMake(0.0f, 0.0f, size.width, size.height); UIGraphicsBeginImageContext(size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [color CGColor]); CGContextFillRect(context, rect); UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return theImage; }
时间: 2024-10-12 14:00:26