UIColor Archives

How to change the background colour of a UIView

You can use the backgroundColor property for this: self.yourView.backgroundColor = [UIColor purpleColor]; Pre-defined values are blackColor darkGrayColor lightGrayColor whiteColor grayColor redColor greenColor blueColor cyanColor yellowColor magentaColor orangeColor purpleColor brownColor clearColor You can also define your own colours by creating a UIColor object (from RGB or HSL values). Here’s how you can create your own RGB […]