Storyboard中选取当前的Controller用Editor-Embed in-NavigationController
在Controller中重写viewWillAppear方法,在其中调用以下函数
func configureTitle() {
let bar = self.navigationController!.navigationBar
bar.barTintColor = NFColor.baroqueBlueColor()
bar.barStyle = UIBarStyle.BlackTranslucent
let font = UIFont(name: "HoeflerText-BlackItalic", size: 23.0)
if let font = font {
bar.titleTextAttributes = [
NSFontAttributeName : font,
NSForegroundColorAttributeName : NFColor.baroqueYellowColor()
]
}
bar.translucent = true
self.title = "Nefi"
}
效果图如下: