I am trying to tint my UI to a nice brown. The pop up associated with the splitter is blackish-blue. How do I change its tint to the one I have applied to the rest of the app?
Here's a picture:
When I change the tint in IB it then looks like this:
Unfortunately the border can not be changed from the grey color..only the title. You need to set the tintcolor property on the navigation bar.
myController.navigationBar.tintColor
Related
This is very odd. My global tint is set and my icons colors are set to the default purple I have. Yet at run time its blue. Any tips? Ive checked around and have not seen anyone else with this problem.
Storyboard:
Run Time:
Basically, when you want to change the tint color of UITabBar programmatically, UITabBar class gives you several tint color properties:
tintColor: TabBarItem's color.
barTintColor : TabBar's background bar's color.
unselectedItemTintColor : color of unselected items.
so if you change the tintColor, barItems' color would be changed.
...but, Why it doesn't works on IB?
When you set a specific color to UITabBar's item in IB, there's an option named Image Tint.
Changing a Tint option on "View" section won't affect anything to TabBar's items but only Image Tint option can change tabBar's item color.
storyboard's global tint color option changes Tint option of "View" section, but doesn't affect default value of Image Tint option, so It doesn't affect the tab bar's tint color.
So.. Why Image Tint option doesn't affected?
I can't explain why doesn't it affected. Maybe Apple had an issue with this, or kind of bug.
there are some workarounds for setting an image color :
Explicitly Set an Image Tint option to UITabBarController's TabBar object.
You may should set every TabBarController's Image Tint option, because it doesn't affects global setting.
Programmatically change global UITabBar's tintColor.
At AppDelegate.swift's didFinishLaunchingWithOptions, paste following code
UITabBar.appearance().tintColor = <#Color what you want#>
I've had a similar problem, which was fixed by changing the "Render As" property to "Default" instead of "Original". You can find this in your Asset Library, when selecting your images on right right hand side under "Render As" in the attributes inspector.
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.
I want the Status Bar of my app to have the exact same color as my Navigation Bar. The way I found to change the color of the Status Bar was just by creating a view in the size of the Status Bar and change the background color.
However even though I use the color picker from the Nav bar to set the color of the view I get 2 totally different colors as seen in the picture below.
I've tried mixing with the color picker, changing opacity etc, however I'm never able to hit the correct color. Any ideas on how I can get the exact same color for the status bar?
The color of the UIStatusBar is automatically set to match the color of the UINavigationBar when you set the value of self.navigationController.navigationBar.barTintColor. Is there a reason you need to set them separately?
You can do the following:
Create an UIImage containing only the color you want with a size of 64x1. You could render that image in code.
Set the image as a background image for the navigationBar. Something like:
navigationController.navigationBar.setBackgroundImage(image, for: .default)
I have set the search bar tint color to a custom color in Interface Builder as so:
But when I load up the app in the simulator it appears like this:
Translucent box is left unticked, so any idea why this is happening?
I'm working with SearchDisplayController and want to apply a style or tint to the searchBar.
But I noticed that the SearchDisplayController makes changes to the style of my searchBar.
For example if I use the "Dark Text Color" tint on my searchBar, when running the app, I'll obtain a grey style. But if I remove the searchDisplayController linked to the searchBar, the style in the app is ok.
This image shows the difference between the searchBar in the storyboard and in the app.
Note: If I use the default style, I don't have any problem.
I don't understand what changes the searchDisplayController adds to the searchBar.
Am I missing something or doing something wrong ?
No, you are not doing something wrong. While I'm not sure why it works this way, I can imagine that a somewhat lighter color is chosen in order to distinguish the cancel button (which will have your tint color).
What worked for me was to set the background color to black, no tint color (default), and use the Black Translucent style.
Also remember that when you set a tint color, the style is ignored.
I remember struggling with this for hours, just to get a black search bar.