如何给button增加下划线简单版
- (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];
}