Alex Rivera | Logout

how to change the background color of the viewController in objective-c

Asked 2010-01-04T08:52:38.910
16

how to change the backgrond color of view controller from other controller in the app ?

Edit
Report

2 Answers

10
UIColor *colour = [[UIColor alloc]initWithRed:57.0/255.0 green:156.0/255.0 blue:52.0/255.0 alpha:1.0];
self.view.backgroundColor = colour;

Adapted from Frank Shearar's answer.

answered 2012-12-29T12:31:42.817
2
UIViewController *yourVC;
UIColor *colour = [[UIColor alloc] initWithRed: 1.0 green: 0.0 blue: 0.0 alpha: 1.0];
[yourVC.view.backgrounColor] = colour;
[colour release];
answered 2010-01-04T12:16:14.927

Your Answer