installed fonts for title navigation bar
UINavigationBar.appearance().titleTextAttributes = [.font: UIFont(name: "OpenSans", size:50 )!,NSAttributedString.Key.foregroundColor : UIColor.purple]
how do I make it bold ?
found, that can be done so, but after all the fine print I already set
.font : UIFont.boldSystemFont(ofSize: 50)
答案 0 :(得分:1)
您必须说要使用的字体命名为 OpenSans ,其样式为粗体
"OpenSans-Bold"
所以使用这个:
.font: UIFont(name: "OpenSans-Bold", size: 50)!
答案 1 :(得分:1)
您应该使用Open Sans的粗体。代替“ OpenSans”,使用与粗体版本ex对应的字符串。 “ OpenSans-Bold”
UINavigationBar.appearance().titleTextAttributes = [.font: UIFont(name: "OpenSans-Bold", size:50 )!,NSAttributedString.Key.foregroundColor : UIColor.purple]
字体名称将特定于您的环境。