美文网首页
label 下划线

label 下划线

作者: CoderChou | 来源:发表于2016-05-26 14:11 被阅读47次

    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 下划线

          本文链接:https://www.haomeiwen.com/subject/gdhxdttx.html