I have a tabbar controller in my iphone app. Everything was fine until the second tabbar item is clicked. When its clicked, the tabbaritem title/name under the tabbar icon for the second tab will disappeared. But there's no problem with the first tab.
Do anybody knows whats the reason for this.
In my case, the title was being set correctly but the color of the title was in "clear color" when selected.
Solution:
In AppDelegate.m
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor blackColor] }
forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor redColor] }
forState:UIControlStateSelected];
It may be the problem with the view controller in the second tab bar item. Have you used the title inside of the view controller of the second tab bar item. If no then try using title of the view controller to the name/title of the second tab bar item. I hope this should solve the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With