How to change the unselected tabbaritem color in iOS7? 这不起作用。
我正在尝试这个
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:[ThemeManager customFont] size:10.0f],
NSForegroundColorAttributeName : [UIColor greenColor]
} forState:UIControlStateSelected];
颜色更改但不是我正在使用的自定义字体。
答案 0 :(得分:1)
找到了解决方案。
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:[ThemeManager customFont] size:17.0f],
NSForegroundColorAttributeName: [UIColor greenColor]}
forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:[ThemeManager customFont] size:17.0f],
NSForegroundColorAttributeName: [UIColor blackColor]}
forState:UIControlStateNormal];