美文网首页
同一个lable中 字的字体颜色 大小不一样

同一个lable中 字的字体颜色 大小不一样

作者: VickyLanLan | 来源:发表于2016-07-25 17:53 被阅读21次

NSMutableAttributedString*att = [[NSMutableAttributedStringalloc]initWithString:self.lableText.text];

[attaddAttributes:@{NSForegroundColorAttributeName:[UIColorcolorWithRed:214/255.0green:159/255.0blue:83/255.0alpha:1],NSFontAttributeName:[UIFontfontWithName:@"Arial-BoldItalicMT"size:16.0]}range:NSMakeRange(0,6)];

[attaddAttributes:@{NSForegroundColorAttributeName:[UIColorcolorWithRed:214/255.0green:159/255.0blue:83/255.0alpha:1],NSFontAttributeName:[UIFontfontWithName:@"Arial-BoldItalicMT"size:16.0]}range:NSMakeRange(33,8)];

[attaddAttributes:@{NSForegroundColorAttributeName:[UIColorcolorWithRed:214/255.0green:159/255.0blue:83/255.0alpha:1],NSFontAttributeName:[UIFontfontWithName:@"Arial-BoldItalicMT"size:16.0]}range:NSMakeRange(95,8)];

self.lableText.attributedText= att;

相关文章

网友评论

      本文标题:同一个lable中 字的字体颜色 大小不一样

      本文链接:https://www.haomeiwen.com/subject/xuzgjttx.html