UILabel Strikethrough

前端 未结 5 1851
孤城傲影
孤城傲影 2020-12-30 07:26

Is it possible to stikethrough a UILabel at all? I can\'t seem to find the option...

5条回答
  •  隐瞒了意图╮
    2020-12-30 07:54

    NSAttributedString *str=[[NSMutableAttributedString alloc]  initWithString:[NSString stringWithFormat:@"¥%.2f", productOne.priceBefore]  attributes:@{NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle)}];
    
    cell.priceBefore.attributedText = str;
    

提交回复
热议问题