Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8, Xcode 6 tab bar image tint

When I select a UIColor for UIImage tint in the UITabBar properties, nothing change, only default blue is shown. I need to call

[[UITabBar appearance] 
  setSelectedImageTintColor:[UIColor colorWithRed:255.0/255.0 
                                            green:150.0/255.0 
                                             blue:10.0/255.0 
                                            alpha:1.0]];

but it's not called on start of the application so the icon is initially blue and change it's color in a second time (even if put in viewWillAppear).

I use as launch screen file the UIStoryboard which has the UITabBarController inside.

Any ideas? Did the selection of the image tint in xcode 6 works via UIInterfaceBuilder?

Thanks

like image 450
zerbfra Avatar asked Oct 02 '14 14:10

zerbfra


People also ask

How do I change the color of my tab bar in Swift?

Add Runtime Color attribute named "tintColor". It will change image tint color as well as title tint color.

How do I add an image to the tab bar in iOS?

iOS UITabBarController Changing Tab Bar Item Title and Icon For a custom icon, add the required images to the assets folder and set the 'System Item' from earlier to 'custom'. Now, set the icon to be shown when the tab is selected from the 'selected image' drop down and the default tab icon from the 'image' drop down.


1 Answers

It is a bug.

you can solve this by using "User Defined Runtime Attributes" to change tabBar.tintColor(for >= iOS7) or tabBar.selectedImageTintColor(for all, but depressed in iOS 8).

Don't using Attributes Inspector. (It do not work)

enter image description here

like image 199
Mornirch Avatar answered Nov 15 '22 06:11

Mornirch