//4.设置Label上的文字
AnswerModel *model = [self getFitModel:tableView];
NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"答案解析:%@",model.bestanswer]];
[AttributedStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:15] range:NSMakeRange(0, 5)];
[AttributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:10/255.0 green:145/255.0 blue:229/255.0 alpha:1.0]range:NSMakeRange(0, 5)];
label.attributedText = AttributedStr;
Lable 富文本代码
最新推荐文章于 2024-05-06 23:22:12 发布