NSStrikethroughStyleAttributeName,如何在iOS 10.3中删除字符串? [英] NSStrikethroughStyleAttributeName , How to strike out the string in iOS 10.3?

查看:106
本文介绍了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.


如果有人发现与此相关的更新答案,请通知此处,我会更新我的答案。

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

产品版本:10.3

创建时间:2017年3月14日

Created: 14-Mar-2017

发起日期:2017年3月14日

Originated: 14-Mar-2017

打开雷达链接: http:// www。 openradar.appspot.com/31034683

雷达状态目前开放状态

您还可以看到替代样本这里可能有用。

you can see the alternate sample also here may be it useful.

这篇关于NSStrikethroughStyleAttributeName,如何在iOS 10.3中删除字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆