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





        //显示下划线

        //中划线

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

        //下划线

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

        NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:oldStr attributes:attribtDic];

        oldPriceLabel.attributedText = attribtStr;



UILabel,文字添加下划线,中划线_第1张图片


UILabel,文字添加下划线,中划线_第2张图片

你可能感兴趣的:(iOS)