swift UIButton中文本添加下划线的方法

var attributedString = NSMutableAttributedString(string:"点击预览")

var range = NSRange()

range.location=0

range.length=attributedString.length

attributedString.addAttributes(attrs, range: range)

// attributedString.appendAttributedString(buttonTitleStr)

rightBtn.setAttributedTitle(attributedString, forState: .Normal)

你可能感兴趣的:(swift UIButton中文本添加下划线的方法)