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