尝试在 iOS 8 中使用外观为所有按钮设置 UIButton 的字体。谷歌搜索后,Apple 似乎已经改变了您在不同操作系统之间执行此操作的方式。在 iOS 7 中,这应该有效:
UIButton.appearance().titleLabel?.font = UIFont.inviteButtonTitleFont()
但它似乎不再起作用了。有人知道你现在是怎么做的吗?
最佳答案
Swift 3:
let fontRegular = UIFont(name: "MyCustomRegularFont", size: 17.0)
UILabel.appearance(whenContainedInInstancesOf: [UIButton.self]).font = fontRegular
UIButton.appearance().tintColor = UIColor.red
关于iOS 8 : UIButton appearance font,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29477616/