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;

    }

  • 相关阅读:
    bzoj4321
    bzoj1800
    codeforces396C
    codeforces400C
    codeforces271D
    关于jsp中jstl-core标签循环遍历的使用
    hibernate坑边闲话2
    hibernate坑边闲话
    hibernate中实体与数据库中属性对应的类型
    MySQL的常用命令:添加外键,修改字段名称,增加字段 设置主键自增长等
  • 原文地址:https://www.cnblogs.com/Jordandan/p/5695929.html
Copyright © 2011-2022 走看看