• 富文本


    代码:

    -(void)setComplaintlistItem:(ComplaintlistItem *)complaintlistItem{

        _complaintlistItem = complaintlistItem;

        [self.yeZhuNameLabel setText:complaintlistItem.YzName];

        [self.stateLabel setText:complaintlistItem.ComplaintStateName];

        [self.appealContentLabel setAttributedText:[self makeAppealContent:complaintlistItem.Content]];

        [self.dateTimeLabel setText:complaintlistItem.CreateTime];

    }

    -(NSMutableAttributedString *)makeAppealContent:(NSString *)rawContent{

        NSString * content = [NSString stringWithFormat:@"申诉内容:%@",rawContent];

        NSDictionary *headText = @{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UtilityHelper colorWithHexString:@"333333"]};

        NSDictionary *normalText = @{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UtilityHelper colorWithHexString:@"666666"]};

        NSMutableAttributedString * textAttributeStr = [[NSMutableAttributedString alloc]initWithString:content attributes:normalText];

        [textAttributeStr addAttributes:headText range:NSMakeRange(0, 5)];

        return textAttributeStr;

    }

  • 相关阅读:
    Python return语句用法分析
    set built-in function
    dict built-in function
    String bulit-in function
    tuple built-in function
    Pyhton:List build-in function
    Python之如果添加扩展包
    关于编辑器
    attachEvent和addEventListener详解
    jquery异步调用页面后台方法
  • 原文地址:https://www.cnblogs.com/Jordandan/p/5695929.html
Copyright © 2020-2023  润新知