UIToolbar incorrect colour in iOS7
Asked Answered
B

3

7

When I set the bottom UIToolbar to black on the view controller, it appears as a more greyish colour (the same thing happens with other colours--it sort of fades them out). What I assume is happening is that in iOS7 the toolbar seems to adapt the colour of what is beneath it (currently white) which makes for the duller colour.

I've updated the view controller so that the "extended edges" options are turned off but still get this effect. Has anyone else had this issue yet?

UPDATE: I resolved the issue by setting the background colour of the UIToolbar to black (something I haven't had to do in previous versions of iOS). If anyone can think of a better solution, let me know.

Balbriggan answered 20/9, 2013 at 0:29 Comment(1)
If its in interface builder just uncheck the translucent property.Tertia
F
13

All tool- and navigation bars in iOS 7 have a translucent property.

This causes the effect, where the background shines through in blurred form (just like the control center).

Just set YourToolbar.translucent = NO;.

Fleshy answered 20/9, 2013 at 0:39 Comment(3)
But when I click off the translucent property, it seems to just make the bar white instead (even though it doesn't look this way in storyboard mode).Balbriggan
Did you set its barTintColor property?Yell
No, it was on default settings, but that didn't seem to help much even when I changed it. I did manage to get it looking correctly by filling the background colour though. I've never had to adjust that before though.Balbriggan
R
10

SET the t*ranslucent property to NO*:-

IN iOS 7 you need to set the barTintColor Property-

UIToolbar *doneToolbar=[[UIToolbar alloc]initWithFrame:CGRectMake(0, 584, 320, 44)];
doneToolbar.translucent=NO;
doneToolbar.barTintColor=[UIColor blackColor];
[self.view addSubview:doneToolbar];

I have used it its working fine...

Rambouillet answered 13/1, 2014 at 5:22 Comment(0)
M
5

setting the background color instead of the bar tint worked for me

I set the bar tint to default, the translucent property to NO and the background to the color i wanted and it worked for me.

Methyl answered 21/1, 2014 at 21:41 Comment(1)
I am unable to edit the translucent property in the interface builder. Checkbox for translucent won't uncheck, tint color won't change, style won't change. Any thoughts why?Heartstricken

© 2022 - 2024 — McMap. All rights reserved.