美文网首页
UILabel富文本设置

UILabel富文本设置

作者: KevinChein | 来源:发表于2018-10-18 10:06 被阅读7次
NSDictionary *attributeDict = @{NSForegroundColorAttributeName: kRGB(51, 51, 51)};
NSString *textStr = [NSString stringWithFormat:@"%@ 回复 你",model.userName];
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:textStr];
NSRange range = [textStr rangeOfString:@"回复"];
[attrStr setAttributes:attributeDict range:range];

相关文章

网友评论

      本文标题:UILabel富文本设置

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