【发布时间】:2013-04-11 02:54:01
【问题描述】:
我想更改 UINavigationBar 标题 的颜色 和字体。我如何使用代码或界面生成器来做到这一点?这可能很容易,但我是 xcode 的新手。感谢您的帮助。
【问题讨论】:
标签: ios xcode fonts colors uinavigationbar
我想更改 UINavigationBar 标题 的颜色 和字体。我如何使用代码或界面生成器来做到这一点?这可能很容易,但我是 xcode 的新手。感谢您的帮助。
【问题讨论】:
标签: ios xcode fonts colors uinavigationbar
对于编码部分,您可以做的是使用标签启动标题视图。
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 10, 40)];
[myLabel setFont:[UIFont fontWithName:@"Arial" size:12]];
[myLabel setTextColor:[UIColor whiteColor]];
[myLabel setText:@"My text here"];
[**your navigation bar**.topItem setTitleView:myLabel];
【讨论】: