- (UIImage*)createImageWithColor:(UIColor*) color
{
    CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return theImage;
}

 

相关文章:

  • 2021-11-29
  • 2021-05-27
  • 2022-01-11
  • 2021-07-11
  • 2022-01-29
  • 2021-09-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-02
  • 2021-06-18
  • 2022-01-18
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案