标签:uifont ted style code fan font ber 认证 table
UILabel *lable = [[UILabel alloc] init];
NSString *str = @"认证地区 未认证";//未认证-红色,下划线
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:str];
//添加字体和设置字体的范围
[attrStr addAttribute:NSFontAttributeName
value:[UIFont systemFontOfSize:30.0f]
range:NSMakeRange(0, 4)];
//添加文字颜色
[attrStr addAttribute:NSForegroundColorAttributeName
value:[UIColor redColor]
range:NSMakeRange(5,3)];
//添加下划线
[attrStr addAttribute:NSUnderlineStyleAttributeName
value:[NSNumber numberWithInteger:NSUnderlineStyleSingle]
range:NSMakeRange(5, 3)];
lable.attributedText = attrStr;
标签:uifont ted style code fan font ber 认证 table
原文地址:http://www.cnblogs.com/justqi/p/7106930.html