Reputation: 1075
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:
Upvotes: 4
Views: 2179
Reputation: 658
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.
Upvotes: 2
Reputation: 341
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.
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.
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 :
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.
At AppDelegate.swift
's didFinishLaunchingWithOptions
, paste following code
UITabBar.appearance().tintColor = <#Color what you want#>
Upvotes: 9