【发布时间】:2014-10-24 21:30:43
【问题描述】:
以下代码在更新到 Xcode 6.1 以跟上 iOS 8.1 之前运行良好:
override func viewDidAppear(animated: Bool) {
self.navigationController?.navigationBar.topItem?.title = "Home"
self.navigationController?.navigationBar.titleTextAttributes = [ NSFontAttributeName: UIFont(name: "Lobster 1.4", size: 34), NSForegroundColorAttributeName: UIColor.whiteColor()]
}
这个问题专门在NSFontAttributeName: UIFont(name: "Lobster 1.4", size: 34)
我在这里遇到的错误是:
! "Could not find an overload for 'init' that accepts the supplied arguments"
我在另一个 StackOverflow 问题上找到了此原始代码,并且在此更新之前它按预期工作(昨天下载了它)。我的字体确实安装正确。
我现在应该以不同的方式编写这段代码,还是有一种全新的方式来设置我的导航栏字体?
谢谢!
【问题讨论】:
标签: ios xcode swift uinavigationcontroller navbar