更改UILabel的字体样式及某段文字中的颜色

来源:互联网 发布:js设置input disabled 编辑:程序博客网 时间:2024/05/21 17:10
 NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:content];    [str addAttribute:NSForegroundColorAttributeName value:WEIXINSYSTEM_COLOR range:range1];    [str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Arial-BoldItalicMT" size:10.0] range:NSMakeRange(0, 5)];    [str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:10.0] range:NSMakeRange(6, 12)];    [str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Courier-BoldOblique" size:10.0] range:NSMakeRange(19, 6)];    cell.awardCount_attLabel.attributedText = str;


原创地址:http://blog.csdn.net/hengshujiyi/article/details/41514927

1 0
原创粉丝点击