UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 20, 375, 40)];
//label.attributedText = attrString;
label.textColor = [UIColor redColor];
NSDictionary *attrDict1 = @{ NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle),NSFontAttributeName: [UIFont systemFontOfSize:18] };
NSString *originStr = @"Hello,World!";
label.attributedText = [[NSAttributedString alloc] initWithString: originStr attributes: attrDict1];
网友评论