ios 10.3+ 系統(tǒng),NSAttributedString 里設(shè)置 文字中間劃線,只要含有漢字就會(huì)不顯示中間線。目測(cè)是ios10.3+系統(tǒng)的bug。ios11和ios10.2 就沒(méi)這個(gè)問(wèn)題。
修改方法:添加設(shè)置 NSBaselineOffsetAttributeName:@(NSUnderlineStyleSingle)
例如:
1.NSAttributedString ?*attrStr =
[[NSAttributedString alloc]initWithString:textStr attributes:
@{NSFontAttributeName:SYS_FONT(17),
NSForegroundColorAttributeName:RSQColorFromHex(0xa3a3a3),
NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle),
NSStrikethroughColorAttributeName:RSQColorFromHex(0xa3a3a3),
NSBaselineOffsetAttributeName:@(NSUnderlineStyleSingle)
}];