颜色大小的特殊处理
NSDictionary *consumDic = @{NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:[UIColor colorWithRed:255 green:255 blue:255 alpha:1.0]};
NSDictionary *moneySignDic = @{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[UIColor colorWithRed:255 green:255 blue:255 alpha:1.0]};
NSMutableAttributedString *mAttrString = [[NSMutableAttributedString alloc] initWithString:@"消费¥0.00/余额0.00" attributes:consumDic];
[mAttrString addAttributes:moneySignDic range:NSMakeRange(2, 1)];
[mAttrString addAttributes:moneySignDic range:NSMakeRange(8, 6)];
consumLabel.attributedText = mAttrString;
时间: 2024-10-27 07:43:56