技术渣苹果又搞事情,具体传送门见:http://stackoverflow.com/questions/43074652/ios-10-3-nsstrikethroughstyleattributename-is-not-rendered-if-applied-to-a-sub
解决方案,增加如下代码:
[[NSAttributedString alloc] initWithString:text attributes:@{NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle), NSFontAttributeName: [UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName: UIColorFromRGB(0xbcbcbc), NSBaselineOffsetAttributeName: @(0)}];
最底下那行是关键