NSMutableAttributedString如果应用范围不是整个字符串范围,则不会呈现作为属性添加到实例的删除线(单,双,...).
出现这种情况使用addAttribute(_ name: String, value: Any, range: NSRange), insert(_ attrString: NSAttributedString, at loc: Int),append(_ attrString: NSAttributedString),...
在早期iOS 10.3测试版中被Apple打破,并未在10.3决赛中修复.
Apple最近发布的iOS 10.3版本,使用前NSMutableAttributedString设置的前锋不显示
[attributedString addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlineStyleSingle | NSUnderlinePatternSolid) range:NSMakeRange(length1 + 7, length2 + 5)];
Run Code Online (Sandbox Code Playgroud)
尝试了很多方法都没有解决,希望能得到大家的帮助