zoukankan      html  css  js  c++  java
  • 富文本

    代码:

    -(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;

    }

  • 相关阅读:
    正在与拖延症病魔抗争中
    Words For Today [20110724]
    短期目标[Till 20110805]
    Words For Today [20110804]
    Words For Today [20110731]
    Words For Today [20110801]
    Words For Today [20110723]
    《定位》一书
    马云的最近的话柱着拐杖跳高
    创业的人格
  • 原文地址:https://www.cnblogs.com/Jordandan/p/5695929.html
Copyright © 2011-2022 走看看