Alex van Rijs
Alex van Rijs

Reputation: 813

change color tabbar icons iOS 5

I am able to restyle the UITabBar with the following commands

[[UITabBar appearance] setSelectionIndicatorImage:
 [UIImage imageNamed:@"tab_select_indicator"]];
[[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];

But how can I set the imageTintColor when the tab isn't selected. The default color is grey and I want to change this to blue.

Thanks

Upvotes: 1

Views: 5781

Answers (2)

Vineesh TP
Vineesh TP

Reputation: 7963

In AppDlegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];
return YES;
}

Upvotes: 3

Christian Loncle
Christian Loncle

Reputation: 1584

From the Apple docs UITabBar Class Reference:

If you want to also customize the unselected image appearance, you must sent setFinishedSelectedImage:withFinishedUnselectedImage: to individual tab bar items.

Upvotes: 3

Related Questions