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?
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.
In ios7 there are 2 properties:
Use barTintColor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With