在做商品信息展示的时候,通常会需要用到删除线,下面介绍下苹果NSAttributedString自带的删除线属性
通常用法:
NSString *oldPrice = @"¥ 12345";
NSUInteger length = [oldPrice length];
NSMutableAttributedString*attributedString = [[NSMutableAttributedString alloc]initWithString:oldPrice];
[attributedString addAttribute:NSForegroundColorAttributeName value:RGBACOLOR(253, 91, 120, 1) range:NSMakeRange(0, length)];
[attributedString addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid|NSUnderlineStyleSingle) range:NSMakeRange(0,