-1

我找不到更改inputAccessoryView. 有人可以帮我吗?

4

2 回答 2

0

要更改 UIBarButtonItem 的字体,请使用以下命令:

[buttonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIFont fontWithName:@"Helvetica-Bold" size:26.0], UITextAttributeFont,nil] forState:UIControlStateNormal];
于 2013-05-16T12:50:07.613 回答
0

如果您正在为 iOS 5.0+ 进行部署,则可以使用UIAppearance代理:

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

此代码将更改子类中所有s (包括 as )中所有UIBarButtonItems (又名按钮)的字体。UIToolbarinputAccessoryViewUIViewController

于 2013-05-16T12:53:21.643 回答