UILabel Strikethrough

前端 未结 5 1885
孤城傲影
孤城傲影 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:55

    UIView* slabel = [[UIView alloc] initWithFrame:CGRectMake(label.frame.origin.x, label.frame.origin.y+10, label.frame.size.width, 2)];
    [self addSubview:slabel];
    [slabel setBackgroundColor:label.textColor];
    

    You can add a view over UILabel and style it with label properties.

提交回复
热议问题