I have the following code in my drawRect:
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextFillPath(context);
I basically wanted to set the background of this view to be red.. however the code above doesn’t do it. What am I doing wrong?
You probably want:
CGContextFillPathfills a “path,” which you’d have to first build with a series of other calls, likeCGContextAddRectandCGContextAddArc. It’s easier just to fill the rect.