本文介绍了NSStrikethroughStyleAttributeName,如何在iOS 10.3中删除字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在iOS 10.3发布之前使用过这行代码,并且工作正常。
I have used this line of code before release of iOS 10.3 ,and worked fine.
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@",strMRP,strOffer]];
[attributeString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:12] range:NSMakeRange(0, strMRP.length)];
[attributeString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:15] range:NSMakeRange(strMRP.length, strOffer.length+1)];
[attributeString addAttribute:NSStrikethroughStyleAttributeName
value:[NSNumber numberWithInteger: NSUnderlineStyleDouble]
range:NSMakeRange(0,strMRP.length)];
但现在它已经停止工作了,有没有其他方法可以进行罢工?
But now it is stopped working ,is there any alternate way to do the strike out ?
推荐答案
这是iOS 10.3中的错误, NSStrikethroughStyleAttributeName
(任何
NSUnderlineStyle
个案)在iOS SDK 10.3上不再有效。
it is the bug in iOS 10.3 ,
NSStrikethroughStyleAttributeName
(any NSUnderlineStyle
cases) is not working any more on iOS SDK 10.3.
产品版本:10.3
创建时间:2017年3月14日
Created: 14-Mar-2017
发起日期:2017年3月14日
Originated: 14-Mar-2017
打开雷达链接:
雷达状态目前开放状态
您还可以看到替代样本可能有用。
you can see the alternate sample also here may be it useful.
这篇关于NSStrikethroughStyleAttributeName,如何在iOS 10.3中删除字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!