0

I can't seem to change the tint color for UITabBarItem's in iOS 9. I'm using objective-c and have tried using titleTextAttributes programmatically, and runtime attributes in storyboard as well. I've read through the documentation, but can't seem to figure this out. In fact I've even created a separate selectedState image, but again, it still tints it system blue.

KingPolygon
  • 4,753
  • 7
  • 43
  • 72
  • try one of these, one should work: [self tabBar].backgroundColor = [UIColor clearColor]; [self view].backgroundColor = [UIColor clearColor]; [self tabBar].translucent = false; [self tabBar].tintColor = [UIColor redColor]; – Larry Pickles Nov 20 '15 at 10:08

2 Answers2

3

You can use the appearance proxy like this:

[[UITabBar appearance]setTintColor:[UIColor black]];

This is working for me on iOS8 and iOS9. I have it in my app delegate - but you can put it in a base class if you like.

Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99
  • Wow. I've been trying this for the past few hours, but when you mentioned `base class` I realized I was entering it inside my view controller and not my tab bar controller. Silly mistake. Thanks! – KingPolygon Nov 20 '15 at 10:15
  • You're welcome. Feel free to mark it as the correct answer if it helped. – Robert J. Clegg Nov 20 '15 at 10:16
1

You can access the TabBar property of tab bar controller and set tint color.

[youTabbarcontroller.tabBar setTintColor:[UIColor anycolor]];
Piyush
  • 1,534
  • 12
  • 32