我使用以下代码更改UITabBarController子类中UITabBaritem的字体。它在iOS 8中工作是否与iOS 7兼容。
谢谢
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:17.0f],
NSForegroundColorAttributeName : [UIColor whiteColor]
} forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:17.0f],
NSForegroundColorAttributeName : [UIColor grayColor]
} forState:UIControlStateSelected];