I'm trying to change the color of a tab bar item in iOS app.
The child view controllers are embedded in an navigation controller.
I have added this code in AppDelegate which just changes the color of the text.
[UITabBarItem.appearance setTitleTextAttributes:
@{NSForegroundColorAttributeName : [UIColor colorWithRed:38/255.0 green:54/255.0 blue:73/255.0 alpha:1.0]}
forState:UIControlStateNormal];
[UITabBarItem.appearance setTitleTextAttributes:@{NSForegroundColorAttributeName : kColorTabbarNavigationBarTint}
forState:UIControlStateSelected];
And inside the image assets,if I make the particular image to be rendered as original it works, but the selection color does not work for the image.
Please let me know what could be done.
Thanks in advance...
Try below code : When you want to set programatically.
Or you can set it in storyboard, Select particular tab item and see below