我正在尝试更改导航栏标题的字体大小。我知道我可以使用以下方法设置其属性:
var attributes = [ NSForegroundColorAttributeName: UIColor.blackColor(), NSFontAttributeName: UIFont(name: "the font name", size: 18)! ]
...
self.navigationController?.navigationBar.titleTextAttributes = attributes
我似乎找不到正确的“系统”字体名称。
我追求默认的字体名称,即系统字体名称。我尝试打印所有可用的字体,却发现它不属于一个系列,并且似乎没有明确的名称。
我认为你需要:
NSFontAttributeName : UIFont.systemFontOfSize(19.0)
或者粗体版本:
NSFontAttributeName : UIFont.boldSystemFontOfSize(19.0)
See 本指南 http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/有关用户界面指南和字体的更多信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)