nputAccessorView修改按钮字体

不知道怎么修改 nputAccessorView 中按钮的字体?我搜索了很久也没找到有效的方法。

谢谢您的帮助。

修改字体的代码:

[buttonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIFont fontWithName:@"Helvetica-Bold" size:26.0], UITextAttributeFont,nil] forState:UIControlStateNormal];

如果你的版本是IOS5.0+

可使用UIAppearance

UIFont *font = // create your font
[[UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class], [self class], nil] setTitleTextAttributes:@{ UITextAttributeFont: font } forState:UIControlStateNormal];