按钮文字添加下划线

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"查看所有中奖记录"];

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

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

[_awardDisplayBtn setAttributedTitle:str forState:UIControlStateNormal];

你可能感兴趣的:(按钮文字添加下划线)