UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 100, 310, 350)];
[label setLineBreakMode:NSLineBreakByWordWrapping];
label.numberOfLines =0;
[label setFont:[UIFont systemFontOfSize:14]];
NSMutableAttributedString *content = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"乔丹 科比 詹姆斯 杜兰特 库里 韦德"]];
NSRange contentRange = {0,[content length]};
// 下划线
[content addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:contentRange];
// label.strikeThroughEnabled=YES
// 删除线
[content addAttribute:NSStrikethroughStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(3,12)];
//字体大小
[content addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:NSMakeRange(0, 2)];
// 字体颜色
[content addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(3, 10)];
//删除线的颜色
[content addAttribute:NSStrikethroughColorAttributeName value:[UIColor greenColor] range:NSMakeRange(8, 10)];
label.attributedText = content;
[self.view addSubview:label];
image.png