Reputation: 1031
I am trying to change the color of the Navigation Bar to an Iphone app.
It works on ios 6 but it doesn't on ios 7
I have read that on ios 7 yo have to set the tint instead of the background and that is what I have done.
Any clue?
Thanks in advance
Upvotes: 0
Views: 107
Reputation: 1496
Try this, Change color as you want.
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
[UINavigationBar.appearance setTintColor:[UIColor redColor]];
[UIToolbar.appearance setTintColor:[UIColor redColor]];
}else{
[UINavigationBar.appearance setBarTintColor:[UIColor redColor]];
}
Upvotes: 0
Reputation: 4005
NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
if ([[ver objectAtIndex:0] intValue] >= 7) {
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
self.navigationController.navigationBar.translucent = NO;
}else {
self.navigationController.navigationBar.tintColor = [UIColor redColor];
}
Upvotes: 1