iOS 10.3删除线无法渲染的bug

技术渣苹果又搞事情,具体传送门见: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)}];

最底下那行是关键

Leave a Reply

Your email address will not be published. Required fields are marked *