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.
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#>
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