Question

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?

Was it helpful?

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]];
}

OTHER TIPS

I don't see why this is a lot of work, it's just setting a property when you create the view.

and having all your views transparent so that you only need to set the colour of your window is a terrible performance hit. Transparent views need to show the views underneath them and this increases the processor load.

You are really better off setting the background colour of your views and keeping them opaque.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top