标签:color for sp on bs ad size tt ui
UILabel * fabLab = [[UILabel alloc]initWithFrame:CGRectMake(50, 140, 200, 30)];
NSMutableAttributedString * aText = [[NSMutableAttributedString alloc] initWithString:@"这是一个很好的东西"];
[aText addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(4, 2)];
// NSMakeRange(从第几个字开始 , 颜色变换的有几个字)
fabLab.attributedText = aText;
fabLab.font = [UIFont systemFontOfSize:14.0f];
[self.view addSubview:fabLab];
label 字体变粗
fabLab.font = [UIFont fontWithName:@"Helvetica-BoldOblique" size:17];
标签:color for sp on bs ad size tt ui
原文地址:http://www.cnblogs.com/zgfblog/p/4050504.html