0

I am having a problem with UITabBar, seems like the call to

[[UITabBar appearance] setSelectedImageTintColor:barColor];

does nothing once the tabbar is showing, if i put the line in the ViewDidLoad (ViewWillAppear) it does work.

Any hint?

DRM
  • 1

1 Answers1

1

in the Apple docs for UITabBar it says

"The tint color to apply to the gradient image used when creating the selected image."

Note the creating, meaning that it reads this property when initalising/creating the tab bar, but it can't be set after. If you wanted to dynamically you'd have to get a little bit fiddly and overlay a semi transparent UIView over the selected image to change the colour, but it's not really ideal... There is some examples of that type of thing here

Changing Tint / Background color of UITabBar

Community
  • 1
  • 1
Sam Clewlow
  • 4,123
  • 23
  • 36