- (void)strikethrouthLineWithLabel:(UILabel *)label {
NSString *oldPrice = label.text;
NSUInteger length = [oldPrice length];
NSMutableAttributedString *attritu = [[NSMutableAttributedString alloc]initWithString:oldPrice];
[attritu addAttributes:@{
NSStrikethroughStyleAttributeName:@(NSUnderlineStyleThick),
NSForegroundColorAttributeName:
label.textColor,
NSBaselineOffsetAttributeName:
@(0),
NSFontAttributeName: label.font
} range:NSMakeRange(0, length)];
label.attributedText = attritu;
}
网友评论