How to change the default grey icon colors for tabBarItems in iOS 7?

370 views Asked by At

I've searched and tried all the possible solutions to no avail. All I want is to change the unselected default grey color to something darker. I'm using Xcode 5 and iOS 7. Would someone help?

(I tried all of these and more: How can I change the text and icon colors for tabBarItems in iOS 7?)

2

There are 2 answers

0
OneSman7 On
realtyTypeTabBar.selectedImageTintColor = [UIColor colorWithRed:206.0/256.0 green:221.0/256.0 blue:166.0/256.0 alpha:1];
[realtyTypeTabBar setSelectionIndicatorImage:[UIImage emptyImageWithSize:itemSize andBackgroundColor:[UIColor colorWithRed:84.0/256.0 green:115.0/256.0 blue:0 alpha:1]]];
for(UITabBarItem* item in realtyTypeTabBar.items)
{
    item.image = [item.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [item setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]} forState:UIControlStateNormal];
    [item setTitleTextAttributes:@{NSForegroundColorAttributeName : realtyTypeTabBar.tintColor} forState:UIControlStateSelected];
}
0
Saeed Rahmatolahi On

you can use story board to change that so easy you just need to select TabBar in the tabBarController in the story board and and in the show identity inspector in the user Defined Runtime Attributes add "unselectedItemTintColor" and change the type to the color and then you can choose the color that you want just like a photo you can see what I said