Kis*_*mar 7 xcode objective-c nsmutablestring ios
我在iOS 10.3发布之前使用过这行代码,并且工作正常.
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)];
Run Code Online (Sandbox Code Playgroud)
但是现在它停止了工作,有没有其他方法来进行击球?
它是在IOS 10.3的bug,NSStrikethroughStyleAttributeName(任何NSUnderlineStyle情况下)未在iOS SDK 10.3更多的工作.
如果有人发现与此相关的更新答案,请通知此处,我会更新我的答案.
产品版本:10.3
创建时间:2017年3月14日
起源:2017年3月14日
Open Radar Link:http://www.openradar.appspot.com/31034683
雷达状态是当前打开状态
你可以在这里看到替代样本可能有用.
| 归档时间: |
|
| 查看次数: |
2654 次 |
| 最近记录: |