123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- //
- // RepListCell.m
- // LNManager
- //
- // Created by EchoShacolee on 2017/5/31.
- // Copyright © 2017年 lee. All rights reserved.
- //
- #import "RepListCell.h"
- #import "NSString+ex.h"
- @interface RepListCell()
- {
-
- UILabel *_title;
- UILabel *_content;
- UILabel *_dqmc;
- UILabel *_qxmc;
- UILabel *_replyContent;
- UILabel *_crTime;
- UILabel *_replyTime;
- UILabel *_tel;
-
- UIView * _view;
- }
- @end
- @implementation RepListCell
- +(RepListCell *)cellForTabelView:(UITableView *)tableView{
-
- RepListCell* cell = [tableView dequeueReusableCellWithIdentifier:@"RepListCell"];
- if (!cell) {
- cell = [[RepListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"RepListCell"];
- }
- return cell;
- }
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
-
- self.selectionStyle = UITableViewCellSelectionStyleNone;
-
- NSArray * textArr = @[@"标题",@"举报内容",@"dqmc",@"qxmc",@"回复内容",@"cr时间",@"回复时间",@"电话"];
- NSMutableArray * labArr = [NSMutableArray new];
- //
- for (int i=0; i<textArr.count; i++) {
- UILabel * lab = [[UILabel alloc]init];
- lab.textColor = [UIColor blackColor];
- lab.textAlignment = NSTextAlignmentLeft;
- lab.font = [UIFont systemFontOfSize:14];
- [self.contentView addSubview:lab];
- [labArr addObject:lab];
- }
- _title = labArr[0];
- _content = labArr[1];
- _dqmc = labArr[2];
- _qxmc = labArr[3];
- _replyContent = labArr[4];
- _crTime = labArr[5];
- _replyTime = labArr[6];
- _tel = labArr[7];
-
- _crTime.textAlignment = NSTextAlignmentRight;
- _crTime.textColor = [UIColor lightGrayColor];
- _crTime.font = [UIFont systemFontOfSize:12];
-
- _content.numberOfLines = 0;
-
- _view = [UIView new];
- _view.backgroundColor = KBackGroundColor;
- [self.contentView addSubview:_view];
- }
- return self;
- }
- - (void)layoutSubviews {
- [super layoutSubviews];
-
- [super layoutSubviews];
- CGFloat wid = self.width;
- CGFloat x,y,w,h,bd;
-
- x = 0;
- w = wid;
- y = 0;
- h = 20;
- _view.frame = setDIYFrame;
-
- x = 20;
- y += h+10;
- bd = 5;
- w = wid - 40;
- h = 17;
- _title.frame = setDIYFrame;
-
- y += h+bd;
- _tel.frame = setDIYFrame;
-
- y += h;
- h = [_content.text heightForWid:w Font:14];
- if (h != 0) {
- y += bd;
- }
- _content.frame = setDIYFrame;
-
- y += h+bd;
- h = 17;
- _crTime.frame = setDIYFrame;
-
- // y += h;
- // _dqmc.frame = setDIYFrame;
- //
- // y += h;
- // _qxmc.frame = setDIYFrame;
- //
- // y += h;
- // _replyContent.frame = setDIYFrame;
- //
- // y += h;
- // _replyTime.frame = setDIYFrame;
-
- }
- - (void)updateWithDic:(NSDictionary *)dic {
- _title.text = [NSString stringWithFormat:@"标题 :%@",dic[@"title"]];
- _tel.text = [NSString stringWithFormat:@"举报人电话 :%@",dic[@"tel"]];
- if ([dic[@"content"] length] != 0) {
- _content.text = [NSString stringWithFormat:@"举报内容 :%@",dic[@"content"]];
- }else{
- _content.text = @"";
- }
- _crTime.text = [NSString stringWithFormat:@"%@",dic[@"crTime"]];
-
-
- _dqmc.text = [NSString stringWithFormat:@"地区名称 :%@",dic[@"dqmc"]];
- _qxmc.text = [NSString stringWithFormat:@"区县名称 :%@",dic[@"qxmc"]];
- _replyContent.text = [NSString stringWithFormat:@"回复内容 :%@",dic[@"replyContent"]];
-
- _replyTime.text = [NSString stringWithFormat:@"回复时间 :%@",dic[@"replyTime"]];
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
-
- // Configure the view for the selected state
- }
- @end
|