更改 UINavigationController 中提示的字体 [英] Change font of prompt in UINavigationController
本文介绍了更改 UINavigationController 中提示的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以帮助我更改 NavigationController 提示字符串中的字体、大小和颜色吗?
can someone help me out in changing font, size and color in prompt string on my NavigationController?
在附件中,我想修改Consulenze"字符串.谢谢大家
In the attachment, I want to modify "Consulenze" string. Thank you everybody
我已经尝试了找到的解决方案 此处 但没有结果.
I already tried the solution found here but no results.
推荐答案
您可以尝试以下方式:1) 在 ViewController 的 viewDidLoad 中添加以下几行:
You can try following ways: 1) In viewDidLoad of your ViewController add this lines:
self.navigationController?.navigationBar.tintColor = UIColor.white
let navigationTitleFont = UIFont(name: "Avenir", size: 20)!
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.font: navigationTitleFont]
2) 您可以创建完全自定义的导航栏,只需将 UIView 添加到您的视图顶部并添加所有必要的元素 - 按钮、标签等.
2) You can create completely custom nav bar, just add UIView to the top your view and add all necessary elements - buttons, labels, etc.
这篇关于更改 UINavigationController 中提示的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文