I'm trying to setSelectedImageTintColor
in iOS 7, but it's not working. Here's the code that I have in my AppDelegate.m
under didFinishLaunchingWithOptions
UITabBarController *tabBarController = (UITabBarController *) self.window.rootViewController;
UITabBar *tabBar = tabBarController.tabBar;
for (UITabBarItem *item in tabBar.items)
{
UIImage *image = item.image;
UIImage *correctImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
item.image = correctImage;
}
[[UITabBar appearance] setTintColor:[UIColor whiteColor]];
[[UITabBar appearance] setSelectedImageTintColor:[UIColor colorWithRed:44.0/255.0 green:176.0/255.0 blue:28.0/255.0 alpha:1.0]];
[[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:51.0/255.0 green:51.0/255.0 blue:51.0/255.0 alpha:1.0]];
It still won't show the selectedImageTintColor. It's white when selected; gray when unselected. What am I doing wrong?
UIImage
withUIImageRenderingModeAlwaysOriginal
mode. – Flowerpot