I have recently updated Xcode to 5.1 and now have issues with the tab bar. In iOS 7 and Xcode 5.0 i used this code:
// Graph tab icon
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *graphTabIcon = [tabBar.items objectAtIndex:0];
UIImage *noRenderGraph = [[UIImage imageNamed:@"graph"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[graphTabIcon setImage:noRenderGraph];
[graphTabIcon setTitle:@"Graph"];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
// Friends tab icon
UITabBarItem *friendsTabIcon = [tabBar.items objectAtIndex:1];
UIImage *noRenderFriends = [[UIImage imageNamed:@"group"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[friendsTabIcon setImage:noRenderFriends];
[friendsTabIcon setTitle:@"Friends"];
// Settings tab icon
UITabBarItem *settingsTabIcon = [tabBar.items objectAtIndex:2];
UIImage *noRenderSettings = [[UIImage imageNamed:@"settings"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[settingsTabIcon setImage:noRenderSettings];
[settingsTabIcon setTitle:@"Settings"];
// Info tab icon
UITabBarItem *infoTabIcon = [tabBar.items objectAtIndex:3];
UIImage *noRenderinfo = [[UIImage imageNamed:@"info"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[infoTabIcon setImage:noRenderinfo];
[infoTabIcon setTitle:@"Info"];
and the result was this :
But now with 7.1 and Xcode 5.1 I get this :
I also tried this code :
[[UITabBar appearance] setSelectedImageTintColor:[UIColor whiteColor]];
and that looked great on iOS 7.1, but on 7 ended up being a slight brown color.
So how can I make it so it works on both?