如何更改標籤中下劃線的顏色?我只想要下劃線來改變顏色,而不是整個文本。顏色只在Swift中加下劃線
我已經使用這個代碼來獲取下劃線:
let underlineAttribute = [NSAttributedStringKey.underlineStyle: NSUnderlineStyle.styleSingle.rawValue]
let underlineAttributedString = NSAttributedString(string: "\(nearSavings[indexPath.row]) ,-", attributes: underlineAttribute)
cell.detailTextLabel?.attributedText = underlineAttributedString
但我不能找到的代碼,設置下劃線顏色。任何人都可以幫忙?