📜  swift uilabel font bold - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:01.540000             🧑  作者: Mango

代码示例1
// Define attributes
let labelFont = UIFont(name: "HelveticaNeue-Bold", size: 18)
let attributes :Dictionary = [NSFontAttributeName : labelFont]

// Create attributed string
var attrString = NSAttributedString(string: "Foo", attributes:attributes)
label.attributedText = attrString