【发布时间】:2012-10-22 10:00:29
【问题描述】:
我决定以正确的方式进行自定义导航栏设计。我的导航栏标题应该用自定义字体“Din Condensed”输入,大小为 23。所以我写了这段代码:
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navigation_background.png"]
forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:@{
UITextAttributeTextColor: [UIColor whiteColor],
UITextAttributeFont: [UIFont fontWithName:@"PFDinTextCondPro-Bold" size:23]
}];
但标题标签似乎无法容纳此字体的文本:
如何使用外观 API 更改 UINavigationBar 标题的大小?我想避免使用自定义 titleView。
【问题讨论】:
标签: objective-c ios uinavigationbar