字符串中加深个别字体颜色和字体大小

NSMutableAttributedString *textColor = [[NSMutableAttributedString alloc]initWithString:_bookPrice.text];

NSRange rangel = [[textColor string] rangeOfString:[_bookPrice.text substringFromIndex:6]];

[textColor addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:rangel];

[textColor addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:17] range:rangel];

[_lable setAttributedText:textColor];

你可能感兴趣的:(字符串中加深个别字体颜色和字体大小)