swift UIButton中文本添加下划线的方法
2016-08-29 本文已影响292人
i得深刻方得S
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)