【问题标题】:Xcode UINavigationBar Text font and color [duplicate]Xcode UINavigationBar 文本字体和颜色 [重复]
【发布时间】:2013-04-11 02:54:01
【问题描述】:

我想更改 UINavigationBar 标题颜色字体。我如何使用代码或界面生成器来做到这一点?这可能很容易,但我是 xcode 的新手。感谢您的帮助。

【问题讨论】:

标签: ios xcode fonts colors uinavigationbar


【解决方案1】:

对于编码部分,您可以做的是使用标签启动标题视图。

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];

【讨论】:

    猜你喜欢
    • 2014-07-03
    • 2011-05-16
    • 1970-01-01
    • 2011-01-07
    • 2015-10-29
    • 1970-01-01
    • 2018-01-16
    • 1970-01-01
    • 2012-05-21
    相关资源
    最近更新 更多