简体   繁体   中英

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

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)

在此输入图像描述

在外观调用中,使用setTintColor而不是setSelectedImageTintColor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM