Appearance in Xcode 4.2 doesn't work

709 Views Asked by At

I added this code in my AppDelegate in didFinishLaunchingWithOptions method:

[[UINavigationBar appearance]setBackgroundColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];

[[UITabBar appearance] setBackgroundColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];

But NavigationBar and TabBar didn't change their color. What I have done wrong? Thanks

1

There are 1 best solutions below

3
On BEST ANSWER

Use setTintColor: instead of setBackgroundColor:

[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];
[[UITabBar appearance] setTintColor:[UIColor colorWithRed:221/256.0 green:36/256.0 blue:40/256.0 alpha:0.0]];