Reputation: 5510
I have created a UIToolBar
in my app that is colored blue, and it showed as blue when I was building it as a iOS 6 but now that I have updated the build to iOS 7 its turned white?
This is my code.
getProjectListToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0, 20.0, screenHeight+20, 44)];
getProjectListToolBar.tintColor = [UIColor colorWithRed:85.0/255.0 green:130.0/255.0 blue:186.0/255.0 alpha:1.0];
getProjectListToolBar.translucent = NO;
getProjectListToolBar.layer.borderWidth = 0.0;
getProjectListToolBar.backgroundColor = [UIColor clearColor];
getProjectListToolBar.layer.borderWidth = 0.5;
getProjectListToolBar.layer.borderColor = [UIColor darkGrayColor].CGColor;
[self.view insertSubview:getProjectListToolBar aboveSubview:self.view];
How can I get it blue again?
Upvotes: 4
Views: 2509
Reputation: 1358
Please remove from you code :
getProjectListToolBar.tintColor = [UIColor colorWithRed:85.0/255.0 green:130.0/255.0 blue:186.0/255.0 alpha:1.0];
and add line
[getProjectListToolBar setBarTintColor:[UIColor colorWithRed:85.0/255.0 green:130.0/255.0 blue:186.0/255.0 alpha:1.0]];
and also check your 'getProjectListToolBar' frame coordinates
Upvotes: 0
Reputation: 47099
You just need to set
getProjectListToolBar.translucent = NO;
In iOS 7 UITabBar
and UINavigationBar
has translucent
property and for both you need to set translucent = NO
, Its just for your information.
EDITED
[getProjectListToolBar setBarTintColor:[UIColor colorWithRed:85.0/255.0 green:130.0/255.0 blue:186.0/255.0 alpha:1.0]];
Because in iOS 7 you need to set barTintColor
instead of tintColor
from this documentation.
I tried with your code in my demo project and it worked for me.
Upvotes: 9
Reputation: 1535
In ios7 there are 2 properties:
Use barTintColor.
Upvotes: 3