iOS 下划线不显示问题

2022-03-30  本文已影响0人  ONE2
NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:@"如何快速收集"];
       [att addAttributes:@{NSForegroundColorAttributeName: UIColor.redColor,
                            NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle),
                            NSUnderlineColorAttributeName: UIColor.redColor,
                            NSBaselineOffsetAttributeName: @(5)}
                    range:NSMakeRange(0, att.string.length)];
       [feedback setAttributedTitle:att forState:UIControlStateNormal];

要使用NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle)
只使用NSUnderlineStylePatternSolid不显示...

上一篇 下一篇

猜你喜欢

热点阅读