Setting background views depending on user settings
Posted
by munchine
on Stack Overflow
See other posts from Stack Overflow
or by munchine
Published on 2010-04-26T00:15:16Z
Indexed on
2010/04/26
0:23 UTC
Read the original article
Hit count: 627
I've got an app where the background needs to be set depending on user preference. The user can change this at any time via settings tab. I've got it working by checking NSUserDefaults in viewWillAppear and setting self.view.backgroundColor. This is really clunky.
The right approach (I thought) is to set the background in the root view and for every views that gets on the stack inherit the background. So in viewDidLoad, I've got
self.view.backgroundColor = [UIColor clearColor];
I would have thought this should work. But all I get is a clear background. Any guidance is greatly appreciated.
© Stack Overflow or respective owner