UILabel,文字添加下划线,中划线

时间:2022-05-11 15:11:33

//显示下划线

//中划线

//        NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};

//下划线

NSDictionary *attribtDic = @{NSUnderlineStyleAttributeName: [NSNumbernumberWithInteger:NSUnderlineStyleSingle]};

NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:oldStrattributes:attribtDic];

oldPriceLabel.attributedText = attribtStr;