【发布时间】:2012-03-26 03:50:28
【问题描述】:
我需要在我的 iPhone 应用程序中更改一个视图控制器的导航栏标题文本的大小。我使用的是iOS5,并尝试了以下代码:
if ([self.tabBarItem respondsToSelector:@selector(setTitleTextAttributes:)]) {
NSLog(@"*** Support method(iOS 5): setTitleTextAttributes:");
[self.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIFont fontWithName:@"AmericanTypewriter" size:20.0f], UITextAttributeFont,
[UIColor blackColor], UITextAttributeTextColor,
[UIColor grayColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)], UITextAttributeTextShadowOffset,
nil]];
}
但这仅适用于 tabBarItem。
【问题讨论】:
标签: iphone objective-c ios uinavigationcontroller