ios 富文本 加颜色 删除线

 UILabel *valueL = [JAppViewTools getLabel:CGRectMake(JFWidth(15), CGRectGetMaxY(proName.frame)+JFWidth(12), KSCreenWidth-JFWidth(30), JFWidth(14)) :JTextFCMake(JFFont(15), rgb(28, 218, 159))];
        valueL.text = [NSString stringWithFormat:@"%@ 金币    ¥%@",proModel.integration,proModel.price];
        
        
        NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc]initWithString:valueL.text];
        NSRange range1 = {valueL.text.length-proModel.price.length-1,proModel.price.length+1};

        //字体颜色
        [attributeStr addAttribute:NSForegroundColorAttributeName value:RGBlightGrayColor range:range1];
//删除线 [attributeStr addAttribute:NSStrikethroughStyleAttributeName value: @(NSUnderlineStyleSingle) range:range1]; valueL.attributedText = attributeStr;

 

posted @ 2018-06-25 15:20  狼狼a够  阅读(1049)  评论(0编辑  收藏  举报