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];
iOS 改变字符串其中一段字体和颜色
最新推荐文章于 2021-01-14 02:02:46 发布