Mark一下
-(UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size
{
CGRect rect =CGRectMake(0,0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context =UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context,color.CGColor);
CGContextFillRect(context, rect);
UIImage *img =UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
本人自建的一个iOS交流群165332140,欢迎各位大神进群交流指导。