- (UIImage*) createImageWithColor: (UIColor*) color
{
CGRect rect=CGRectMake(0,0,1, 1);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}
self.view.backgroundColor = [UIColor colorWithRed:242/255.0green:242/255.0blue:242/255.0alpha:1.0f];
UIImage * image1 = [[UIImagealloc]init];
UIImage * image2 = [[UIImagealloc]init];
image1 = [selfcreateImageWithColor:[UIColorcolorWithRed:246/255.0green:246/255.0blue:246/255.0alpha:1.0f]];
image2 = [selfcreateImageWithColor:[UIColorwhiteColor]];