uwking

导航

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)];

posted on 2015-12-08 20:50  uwking  阅读(111)  评论(0编辑  收藏  举报