添加下划线

UILabel* content = [[UILabel alloc] init] ;

content.text = @"good"

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:content.text];

NSRange strRange = {0,[str length]};

[str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:strRange];

[content setAttributedText:str];

你可能感兴趣的:(添加下划线)