我想设置UIBarButtonItem
,以便在我的应用中使用不同的字体。我正在使用appearance
执行此操作,但是我遇到了如何在选中时以粗体显示字体的问题。这就是我想要做的事情:
var barButtonItemApperance = UIBarButtonItem.appearance()
barButtonItemApperance.setTitleTextAttributes([NSFontAttributeName : UIFont(name: "Apple SD Gothic Neo", size: 16)!], forState: UIControlState.Normal)
barButtonItemApperance.setTitleTextAttributes([NSFontAttributeName : UIFont(name: "Apple SD Gothic Neo", size: 16)!], forState: UIControlState.Selected) // I want this to be in bold text
有谁知道我怎么能做到这一点?字体绝对100%以粗体显示。
答案 0 :(得分:0)
使文本变为粗体,这是一般语法:
customLabel.font = [UIFont boldSystemFontOfSize:16.0f]
但您可以简单地选择字体的粗体版 Apple SD Gothic Neo ,以下是列表: