Search code examples
iosxcodexcode5

Custom tab bar icon colors


Im currently using Xcode 5 to develop a list oriented app. I have a custom tint for the tab bar, custom images for the tab icons, custom tint for the tab bar's icon images when its selected, but i cannot find how to customize the icon images' tint for when its not selected. Right now its just the default gray which you can barely see in contrast to my green tab bar. I want to make the tab bar icons' images and names white.

Does anybody know how to set the tab bar icons' image tint in Xcode 5?


Solution

  • You can try this to tint selected icon :

    // Custom the tab bar
    [[UITabBar appearance] setSelectedImageTintColor:[UIColor whiteColor]];
    

    and this to tint the non active icon :

    [self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"item_seleted.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"item_unselected.png"]];