iOS 字串上劃線

weixin_34019929發表於2016-11-08

NSString *str = goods.onegoods_totalPrice;

NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:str];

NSUInteger length = [str length];

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

[self.orderOriginalPrice setAttributedText:attri];

相關文章