我有一个标签:
label.numberOfLines = 0
Run Code Online (Sandbox Code Playgroud)
而我正在努力使这个标签的文字删除:
let index: NSMutableAttributedString = NSMutableAttributedString(string: label.text!)
index.addAttributes([NSStrikethroughStyleAttributeName: NSUnderlineStyle.styleSingle.rawValue, NSStrikethroughColorAttributeName: UIColor.red], range: NSMakeRange(0, index.length))
label.textColor = UIColor.red
label.attributedText = index
Run Code Online (Sandbox Code Playgroud)
属性字符串是否适用于多行或使用numberOfLines设置为0的标签?如果是这样,如何使多行文字删除?