<分区>
我在这里尝试了一些答案来为整个应用程序设置自定义字体,但似乎没有一个在 Xcode 10.1 中工作。我想知道是否有人有一些建议?
这是我到目前为止尝试过的;
Using custom font for entire iOS app swift
Set a default font for whole iOS app?
这是一个代码示例:(这仍然给我系统字体)
override func viewDidLoad() {
super.viewDidLoad()
UILabel.appearance().font = UIFont(name: "Times New Roman", size: 17)
let label1 = UILabel(frame: CGRect(x: 50, y: 50, width: 100, height: 100))
label1.text = "Hello"
view.addSubview(label1)
}
谢谢!