Bar Tint on UIToolBar when translucent is false - ios

I try to set the Bar Tint Color (in Interface Builder) on a UIToolbar that has translucent set to off. No matter the color I choose, the toolbar is always white in the emulator (it changes color in IB). I need to set translucent to true in order to have my UIToolbar with the right Bar Tint. From the Apple doc, I don't see anywhere mentioned that barTintColor is not working when translucent is set to false.
Thanks
Edit
It looks like this is an issue only in interface builder, setting Bar Tint Color in code is working, anyone can confirm?

from the docs
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIToolbar_Class/#//apple_ref/occ/instp/UIToolbar/translucent
If you set this property to NO on a toolbar with a translucent custom background image, the toolbar provides an opaque background for the image using black if the toolbar has UIBarStyleBlack style, white if the toolbar has UIBarStyleDefault, or the toolbar’s barTintColor if a custom value is defined.

Related

Why the navigation bar tint color is faded?

I'm currently working on an iOS application in swift. Here I have UIView on the top of the screen and have UINavigationController. And I need the topView and navigationBar color to be same. And I gave the topBar background color and navigationBar tint color as same. But when the screen loads, the navigationController is showing a faded color. Why?
I tried through programmatically,
self.navigationController?.navigationBar.barTintColor = UIColor.red
Also, I tried through storyboard, like giving the navigationBar's tintColor as red. But in both ways, it's not working.
Please help me.
Set navigationController?.navigationBar.isTranslucent = false to have a solid color navigation bar.
By default the property translucent is set to yes which desaturates any color applied to the navigation bar.
To disable this behaviour just select the navigation bar in your storyboard and disable the checkbox labeled "translucent" in the attribute inspector.

iOS UISearchBar always translucent

I have UISearchBar and I have set the Translucent property to false both in the Xcode editor and in code.
However the UISearchBar always remains translucent and it looks terrible next to my navigation bar, which I have also set the Translucent to false.
How can I set the UiSearchBar bar tint color without it being translucent?
Rant:
Why on earth would iOS not let you set the color of a component exactly as you want it? To sneakily alter the color in the background is unbelievable!
Edit
Code to set the translucent to false.
historySearchBar.Translucent = false;
Designer set translucent off.
Result is still a translucent UISearchBar.

Navigationbar Color confusion

Environment: Xcode 8 and iOS 10.
I am try to set navigation bar color without writing codes.
This is my main UI color when the app is launched. I plan to set the Navigation bar with the same color. However, the color is a little light when it is tested.
As you can see, the color in Navigation bar is a light shade. I set the navigation bar color in the property attribute.
How to resolve this? Thanks in advance.
In attribute inspector, try unchecking Translucent property. And set Bar Tint property to your desired color.

iPhone not displaying accurate color

I'm working on a simple WebView app where I want the Statusbar to be the same color as the Taskbar from the website.
What I did was setting the background color of the View to the same color as the Taskbarby using the color picker. However when I run the app I'm getting a completely different color as you can see below:
These are the settings for the view:
The color code of the Taskbar is: #242424
However the color code the statusbar gets is: #1b1b1b even though I've selected the #242424 color via the color picker.
Why does it seem to do this?
It has to do with the translucency of the bar, as explained in these answers.
You also have to consider that the view extends under the translucent bar, and the view's background color will slightly change the appearance of any translucent bars above it, because of the visual effect used by the bar.
You may want to not set a specific color for the status bar, and let it inherit the bar's color, to give the task bar and status bar a uniform appearance.
Xcode Colour picker not pick exact same colour. Try this macro(set your colour code)
#define CODE_1_COLOR [UIColor colorWithRed:(140.0f/255.0f) green:(132.0f/255.0f) blue:(124.0f/255.0f) alpha:1.0f]
Also take care about Translucent property in case of navigation bar
[[UINavigationBar appearance] setTranslucent:NO];

Status bar color is different to UINavigationBar color

I have a custom UINavigationBar which I am using to remove the gradient of the navbar in iOS 6. Though the color of the status bar is equal to the color of the screen opposed to the color of the bar
Is there a way to make them the same color or at least make the status bar black. My problem is in ios7.
Also if I change the style of the UINavigationBar translucent to NO like this:
self.navigationController.navigationBar.translucent = NO;
Then the status bar goes completely black with no writing on it.
In your project info plist, change UIViewControllerBasedStatusBarAppearance value, if there is no, then add this key.

Resources