标签:
UILabel *label = [[UILabel alloc] init]; label.text = @"UILabel多种字体"; UIFont *font = [UIFont systemFontOfSize:14]; UIColor *color = [UIColor redColor]; NSRange range = NSMakeRange(0, 1); //设置不同字体颜色 NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:label.text]; //设置字体 [attrStr addAttribute:NSFontAttributeName value:font range:range]; //设置颜色 [attrStr addAttribute:NSForegroundColorAttributeName value:color range:range]; label.attributedText = attrStr;
标签:
原文地址:http://www.cnblogs.com/dxer/p/5804208.html