iOS 7.1:UITabBarItems具有默认颜色

时间:2014-03-10 21:41:08

标签: uitabbaritem

在7.1更新后,该行似乎无法正常工作:

NSDictionary *tabBarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithRed:0.059 green:0.737 blue:0.596 alpha:1.0], NSForegroundColorAttributeName, nil];
[[UITabBarItem appearance] setTitleTextAttributes:tabBarTitleTextAttributes forState:UIControlStateSelected];

1 个答案:

答案 0 :(得分:0)

它对我有用。

[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor redColor]} forState:UIControlStateSelected];

我的设置

  • iPhone 4s
  • XCode 5.1
  • iOS 7.1