Search code examples
iosios8uitabbaruicoloruitabbaritem

UIColor of tab bar items unselected and changing tabbar color


I see by using the setTintColor on a tabBar I can change the selected item color.

How do I change the unselected tabBarItem color and text?

If I can't change it easily, what is the default gray color used (in RGB)?

Thanks.


Solution

  • You can use images for tabBarItems.

    To set unselected image use:

    [tabBarItem setImage:(UIImage*)image]
    

    To set selected image use:

    [tabBarItem setSelectedImage:(UIImage*)image]
    

    Text in tabBarItem is title of viewController thats connected to that tabBarItem.

    You can find good icons for tabBar online, here's good one: https://icons8.com/