uitabbaritem改变字体大小

时间:2015-02-27 06:29:59

标签: ios

我使用以下代码更改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];

0 个答案:

没有答案