可悲的是,IB 中没有任何内容。所以你应该在代码中做到这一点:
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.firstLineHeadIndent = 20.0
checkButton.attributedTitle = NSAttributedString(string: checkButton.title, attributes: [NSParagraphStyleAttributeName : paragraphStyle])
Run Code Online (Sandbox Code Playgroud)
这是它的样子: