iOS 10.3系统富文本设置中划线失效

富文本中有中文字符会设置失效(10.3)
原因:可能是苹果10.3系统的bug.
解决方法:让富文本支持中文
NSBaselineOffsetAttributeName : @(NSUnderlineStyleSingle)

NSString *str = [NSString stringWithFormat:@"中文字符¥%@",@"9999"];
        NSMutableAttributedString *attributeMarket = [[NSMutableAttributedString alloc] initWithString:str];
        [attributeMarket setAttributes:@{NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle), NSBaselineOffsetAttributeName : @(NSUnderlineStyleSingle)} range:NSMakeRange(0,str.length)];

        _label.attributedText = attributeMarket;

一下链接是网上大神总结的比较详细的富文本使用方法

传送门1
传送门2
强大的第三方富文本框架

你可能感兴趣的:(iOS 10.3系统富文本设置中划线失效)