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

前端之家收集整理的这篇文章主要介绍了NSStrikethroughStyleAttributeName,如何在iOS 10.3中删除字符串?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在iOS 10.3发布之前使用过这行代码,并且工作正常.
  1. NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@",strMRP,strOffer]];
  2.  
  3. [attributeString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:12] range:NSMakeRange(0,strMRP.length)];
  4.  
  5. [attributeString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:15] range:NSMakeRange(strMRP.length,strOffer.length+1)];
  6.  
  7. [attributeString addAttribute:NSStrikethroughStyleAttributeName
  8. value:[NSNumber numberWithInteger: NSUnderlineStyleDouble]
  9. range:NSMakeRange(0,strMRP.length)];

但是现在它停止了工作,有没有其他方法可以进行罢工?

解决方法

它是iOS 10.3中的错误,NSStrikethroughStyleAttributeName(任何NSUnderlineStyle案例)在iOS SDK 10.3上不再起作用.

if anyone found the updated answer related to this,please inform here,I will update my answer.

产品版本:10.3

创建时间:2017年3月14日

起源:2017年3月14日

Open Radar Link:http://www.openradar.appspot.com/31034683

雷达状态是当前打开状态

你可以看到备用样本也是here可能有用.

猜你在找的iOS相关文章