Closed tiskender2 closed 4 years ago
let attributedText = NSMutableAttributedString(string: postContent) mentionRange = NSRange(location: 0, length: 10) attributedText.addAttribute(NSAttributedString.Key.underlineStyle , value:NSUnderlineStyle.single.rawValue, range: mentionRange!) attributedText.addAttribute(.backgroundColor , value: UIColor.red, range: NSMakeRange(0, 10)) activeLabel.attributedText = attributedText
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
AND? It still doesn't work
AND?
let attributedText = NSMutableAttributedString(string: postContent) mentionRange = NSRange(location: 0, length: 10) attributedText.addAttribute(NSAttributedString.Key.underlineStyle , value:NSUnderlineStyle.single.rawValue, range: mentionRange!) attributedText.addAttribute(.backgroundColor , value: UIColor.red, range: NSMakeRange(0, 10)) activeLabel.attributedText = attributedText
instead of range it's set attributed whole text