NSStrikethroughStyleAttributeName
全部标签 我在iOS10.3发布之前就使用了这行代码,并且运行良好。NSMutableAttributedString*attributeString=[[NSMutableAttributedStringalloc]initWithString:[NSStringstringWithFormat:@"%@\n%@",strMRP,strOffer]];[attributeStringaddAttribute:NSFontAttributeNamevalue:[UIFontboldSystemFontOfSize:12]range:NSMakeRange(0,strMRP.length)];[a
我有一个不带NSStrikethroughStyleAttributeName属性的可变属性字符串,如下所示:NSMutableAttributedString*str1=[[NSMutableAttributedStringalloc]initWithString:@"aaaa"attributes:@{NSStrikethroughStyleAttributeName:[NSNumbernumberWithInteger:NSUnderlineStyleSingle]}];和另一个具有NSStrikethroughStyleAttributeName属性的可变属性字符串,如下所示:
如果应用范围不是整个字符串范围,则不会呈现作为属性添加到NSMutableAttributedString实例的删除线(单、双、...)。这发生在使用addAttribute(_name:String,value:Any,range:NSRange),insert(_attrString:NSAttributedString,atloc:Int),append(_attrString:NSAttributedString),...在早期的iOS10.3测试版中被Apple破坏,在10.3final中没有修复。信用:https://openradar.appspot.com/3103