NSMutableAttributedString

NSMutableAttributedString

NSMutableAttributedString *msAttriStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"this is book ",departmentStr,departmentStatistics.d_count]];

//设置字体大小

[msAttriStr addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18.0f]} range:NSMakeRange(0,length];

//设置字体颜色

[msAttriStr addAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} range:NSMakeRange(0, length)];

05-04 00:52