Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set custom UITabBar font color under iOS7

It seems that [[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]]; is no longer working propertly under iOS7. I can set the background image, but the selected text is no longer getting the red color. I'm calling this from my application delegate. Has anyone tried to set the UITabBar font color and style under iOS7?

like image 655
amb Avatar asked Jan 13 '23 09:01

amb


2 Answers

It worked for me..

[[UITabBar appearance] setBarTintColor:[UIColor blackColor]];
[[UITabBar appearance] setTintColor:[UIColor whiteColor]];
like image 78
Mak083 Avatar answered Jan 28 '23 07:01

Mak083


It is tintColor in iOS7, try the below:

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

Edit:

To tint the non active buttons, put the below code in your VC's viewDidLoad:

[self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"item_seleted.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"item_unselected.png"]];
like image 39
Tarek Hallak Avatar answered Jan 28 '23 06:01

Tarek Hallak