iOS文字加一个横线

```

UITableViewCell * cell;

NSUInteger length = [cell.textLabel.text length];

NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:cell.textLabel.text];

[attri addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(0, length)];

[attri addAttribute:NSStrikethroughColorAttributeName value:[UIColor grayColor] range:NSMakeRange(0, length)];

[cell.textLabel setAttributedText:attri];

```

你可能感兴趣的:(iOS文字加一个横线)