I changed tab bar background in Bar Tint field and want to change text colour for tab bar button. By default is grey and blue. I try to change field Tint in section View, but it doesn't help.
0
votes
3 Answers
0
votes
0
votes
This is for selected state:
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]} forState:UIControlStateSelected];
This is for not selected state:
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor greenColor]} forState:UIControlStateNormal];
0
votes
Try it
To change tabbar text color you can use this
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary [UIColor redColor], UITextAttributeTextColor,[UIColor redColor],UITextAttributeTextShadowColor,[NSValue valueWithUIOffset:UIOffsetMake(0, 0.5)], UITextAttributeTextShadowOffset,[UIFont fontWithName:@"Arial" size:10], UITextAttributeFont,nil]forState:UIControlStateNormal];