NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:title];
[attributeString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:15] range:NSMakeRange(0, 4)];
[attributeString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:13] range:NSMakeRange(4,[title length]- 4)];
[attributeString addAttribute:NSForegroundColorAttributeName value:[UIColor orangeColor] range:NSMakeRange(4,[title length]- 4)];
_naviLabel.attributedText = attributeString;
同一labeltext设置不同的属性
最新推荐文章于 2022-05-18 00:25:50 发布