Ios7 iOS 7 UIBarButtonItem设置字体高亮显示时不起作用

Ios7 iOS 7 UIBarButtonItem设置字体高亮显示时不起作用,ios7,uibarbuttonitem,Ios7,Uibarbuttonitem,我使用这些功能来更改导航栏项目的字体和颜色,在iOS 7之前它工作正常,但在iOS 7中,当在此视图控制器中显示警报时,左侧导航项目将其颜色更改为蓝色,字体更大。搜索后,我可以使用 [[UIBarButtonItem appearance] setTitleTextAttributes:titleAttributes forState:UIControlStateNormal]; [[UIBarButtonItem appearance] setTitleTextAttributes:title

我使用这些功能来更改导航栏项目的字体和颜色,在iOS 7之前它工作正常,但在iOS 7中,当在此视图控制器中显示警报时,左侧导航项目将其颜色更改为蓝色,字体更大。搜索后,我可以使用

[[UIBarButtonItem appearance] setTitleTextAttributes:titleAttributes forState:UIControlStateNormal];
[[UIBarButtonItem appearance] setTitleTextAttributes:titleAttributes forState:UIControlStateSelected];
[[UIBarButtonItem appearance] setTitleTextAttributes:titleAttributes forState:UIControlStateDisabled];
把颜色改成蓝色


但是如何更改字体?

将此添加到“标题属性”词典中:

 [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; 

改变字体?你是说改变字体大小还是字体?您没有设置
UIControlStateHighlighted
文本状态。更改字体大小,设置UIControlStateHighlighted文本状态也不起作用。对我来说,同样的类型在iOS7上不起作用,我正在为所有不同的状态更新字体颜色。它只显示禁用状态的默认深灰色,即使我已将其更改为其他值。
NSDictionary *titleAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:16.0], UITextAttributeFont,  nil];