2

Our designers want to change the color of the default UITabBar. Of course they do.

They want the background to be green, and the icon highlights to be white, as opposed to the black/blue default color scheme.

Anyone have any experience or suggestions to do this?

Matt Dawdy
  • 19,247
  • 18
  • 66
  • 91

7 Answers7

9

You have to subclass the UITabBarController and implement custom drawing.

Check out this SO question. Changing Tint / Background color of UITabBar

Community
  • 1
  • 1
JWD
  • 12,188
  • 3
  • 34
  • 32
  • 2
    Wow. I can't believe I missed that one. I SWEAR I searched an read through several but somehow I missed that one. Thanks. – Matt Dawdy May 12 '09 at 16:12
8

Since iOS5 is released, you can now use the property tintColor. i.e.:

tabBar.tintColor = [UIColor greenColor];
anka
  • 3,817
  • 1
  • 30
  • 36
2

I have try this one and its working for me!!!

[self.TabBarController.tabBar setTintColor:[UIColor colorWithRed:0.1294 green:0.5686 blue:0.8353 alpha:1.0]];


[self.TabBarController.tabBar setTintColor:[UIColor "YOUR COLOR"];

Hope it'll help you also!!!

Muhammad Rizwan
  • 3,470
  • 1
  • 27
  • 35
1

iOS 5.0 fixes this issue but the solution is under NDA. Look up UITabBar in your documentation for an EASY way to do what you want to do.

Ethan Allen
  • 14,425
  • 24
  • 101
  • 194
0

Theres a useful link here: http://duivesteyn.net/2010/01/16/iphone-custom-tabbar-background-image/

oberbaum
  • 2,451
  • 7
  • 36
  • 52
0

Be careful. If your app is going for submission to the app store, Apple may reject it if you're modifying their prescribed color scheme.

Marc W
  • 19,083
  • 4
  • 59
  • 71
  • 2
    Great point, but I'm not that worried about it. Epicurious has an app that has a red tabbar with white icons. – Matt Dawdy May 12 '09 at 16:11
  • 3
    Apple won't reject for custom tab/nav bars unless they interfere with usability - i.e. hot pink on neon green. – ceejayoz May 12 '09 at 16:40
-1

This can be done with a little private API hacking.

Community
  • 1
  • 1
rpetrich
  • 32,196
  • 6
  • 66
  • 89