swift 有没有什么办法可以设置lable的行高呢? 因为设计稿上的行高比较高 默认的解决不了
NSAttributedString
+ NSMutableParagraphStyle
举个栗子:
let label = UILabel()
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1
let attributedString = NSAttributedString(string: "Some of content", attributes: [NSParagraphStyleAttributeName: paragraphStyle])
label.attributedText = attributedString