【发布时间】:2013-11-24 18:51:29
【问题描述】:
所以我已经能够像这样更改 UINavigationBar 中主要文本的文本大小和颜色:
[[UINavigationBar appearance] setTitleTextAttributes:@{
UITextAttributeTextColor: [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeFont: [UIFont fontWithName:@"Arial-Bold" size:0.0],
}];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
但是,leftbarbuttonitem 的字体还是太大了。如何引用 leftbarbuttonitem 以便为它设置文本样式?
我尝试过类似的东西
[UINavigationBar leftBarButtonItem]
[[UINavigationBar navigationItems] leftBarButtonItem]
[[UINavigationBar appearance] leftBarButtonItem]
// and many others
etc...
但是xcode一直抱怨它不存在,我一直无法引用它。
谁能告诉我如何根据我上面的代码设置 leftBarButtonItem 的文本大小?
谢谢
【问题讨论】:
标签: uinavigationbar