标签:nsstring tab uil number round add attr size mutable
- (void)setUnderLineForButton:(UIButton *)btn withTitle:(NSString *)title{
//利用富文本的方式增加button下划线
NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:title];
NSRange strRange = {0,[str length]};
[str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:strRange];
[btn setAttributedTitle:str forState:UIControlStateNormal];
}
标签:nsstring tab uil number round add attr size mutable
原文地址:https://www.cnblogs.com/lsnow/p/9889471.html