label中有文字的时候添加删除线无效
2017-10-26 本文已影响7人
申申申申申
需要添加 {NSBaselineOffsetAttributeName : @0}
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:@"市场价:"];
[attStr appendAttributedString:[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"¥ %@", _goodDetailModel.goodsMarketPrice] attributes:@{NSStrikethroughStyleAttributeName : @(NSUnderlinePatternSolid | NSUnderlineStyleSingle), NSBaselineOffsetAttributeName : @0}]];
marketPriceLabel.attributedText = attStr;