//行间距
func ParagraphStyle(string:String,lineSpacing:CGFloat) -> NSMutableAttributedString {
let paragraphStye =NSMutableParagraphStyle()
//调整行间距
paragraphStye.lineSpacing= lineSpacing
paragraphStye.lineBreakMode = NSLineBreakMode.byWordWrapping
let attributedString =NSMutableAttributedString.init(string: string, attributes: [NSAttributedString.Key.paragraphStyle:paragraphStye])
return attributedString
}
网友评论