Search code examples
iosbackgroundios7uicolor

Change background color in App delegate


I cant seem to change the color of the background of all views in the app delegate.

In ios6 this worked:

window.backgroundColor =[UIColor blueColor];

and be setting the background to clear in each UIView.

But this doesnt work in iOS7 for some reason. I can set the color of the background in each view no problem but this is a lot of work, there must be an easier way? Any advice?


Solution

  • That's a terrible way to change the background color! If anything is moving, the animations will slow down from all the transparency. Change the view's backgroundColor in each view controller:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        [[self view] setBackgroundColor:[UIColor redColor]];
    }