如何更改标签中下划线的颜色?我只想要下划线来改变颜色,而不是整个文本。颜色只在Swift中加下划线
我已经使用这个代码来获取下划线:
let underlineAttribute = [NSAttributedStringKey.underlineStyle: NSUnderlineStyle.styleSingle.rawValue]
let underlineAttributedString = NSAttributedString(string: "\(nearSavings[indexPath.row]) ,-", attributes: underlineAttribute)
cell.detailTextLabel?.attributedText = underlineAttributedString
但我不能找到的代码,设置下划线颜色。任何人都可以帮忙?