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?
An easier way to change the background color of a view is:
view.backgroundColor = [UIColor redColor];
Or if you are in the view controller:
self.view.backgroundColor = [UIColor redColor];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With