label 下划线

UILabel*costPrice = [UILabel new];

NSString*strPrice =@"原价:¥35.00";

costPrice.text= strPrice;

costPrice.textColor= [UIColorgray Color];

costPrice.textAlignment=NSTextAlignmentLeft;

costPrice.font=FONT12;

[titleViewaddSubview:costPrice];

[costPricemas_makeConstraints:^(MASConstraintMaker*make) {

make.bottom.equalTo(titleView).with.offset(-5);

make.left.equalTo(priceLab.mas_right).with.offset(10);

make.width.equalTo(@100);

}];

NSAttributedString*attrStr =[[NSAttributedString alloc]initWithString:strPriceattributes:@{

NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid),

NSStrikethroughColorAttributeName:[UIColorgrayColor]}];

costPrice.text= strPrice;

costPrice.attributedText= attrStr;


你可能感兴趣的:(label 下划线)