码迷,mamicode.com
首页 > 其他好文 > 详细

富文本

时间:2016-07-22 18:56:35      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

代码:

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

}

富文本

标签:

原文地址:http://www.cnblogs.com/Jordandan/p/5695929.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!