草庐IT

NSStrikethroughStyleAttributeName

全部标签

ios - NSStrikethroughStyleAttributeName , 如何在 iOS 10.3 中删除字符串?

我在iOS10.3发布之前就使用了这行代码,并且运行良好。NSMutableAttributedString*attributeString=[[NSMutableAttributedStringalloc]initWithString:[NSStringstringWithFormat:@"%@\n%@",strMRP,strOffer]];[attributeStringaddAttribute:NSFontAttributeNamevalue:[UIFontboldSystemFontOfSize:12]range:NSMakeRange(0,strMRP.length)];[a

ios - NSMutableAttributedString 的属性 NSStrikethroughStyleAttributeName 在 iOS8 中不能正常工作

我有一个不带NSStrikethroughStyleAttributeName属性的可变属性字符串,如下所示:NSMutableAttributedString*str1=[[NSMutableAttributedStringalloc]initWithString:@"aaaa"attributes:@{NSStrikethroughStyleAttributeName:[NSNumbernumberWithInteger:NSUnderlineStyleSingle]}];和另一个具有NSStrikethroughStyleAttributeName属性的可变属性字符串,如下所示:

iOS 10.3 : NSStrikethroughStyleAttributeName is not rendered if applied to a sub range of NSMutableAttributedString

如果应用范围不是整个字符串范围,则不会呈现作为属性添加到NSMutableAttributedString实例的删除线(单、双、...)。这发生在使用addAttribute(_name:String,value:Any,range:NSRange),insert(_attrString:NSAttributedString,atloc:Int),append(_attrString:NSAttributedString),...在早期的iO​​S10.3测试版中被Apple破坏,在10.3final中没有修复。信用:https://openradar.appspot.com/3103