// // SystemmessageCell.m // jitao // // Created by 罗云飞 on 2017/12/9. // Copyright © 2017年 罗云飞. All rights reserved. // #import "SystemmessageCell.h" @implementation SystemmessageCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { _image = [UIImageView new]; [self.contentView addSubview:_image]; _image.sd_layout .leftSpaceToView(self.contentView, 15) .topSpaceToView(self.contentView, 10) .heightIs(fitScreenWidth(18)) .widthIs(fitScreenWidth(18)); _time = [UILabel new]; _time.textColor = [UIColor colorWithString:@"#9A9A9A"]; _time.font = NewFont(fitScreenWidth(11)); [_time setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_time]; _time.sd_layout .leftSpaceToView(_image, fitScreenWidth(11)) .centerYEqualToView(_image) .heightIs(10); _message = [UILabel new]; _message.textColor = [UIColor colorWithString:@"#3C3C3C"]; _message.font = NewFont(fitScreenWidth(13)); _message.numberOfLines = 1; _message.lineBreakMode = NSLineBreakByTruncatingTail; [self.contentView addSubview:_message]; _message.sd_layout .leftSpaceToView(self.contentView, 15) .rightSpaceToView(self.contentView, 15) .heightIs(12) .topSpaceToView(self.contentView, fitScreenWidth(38)); _line = [UILabel new]; _line.backgroundColor = NewLineGrayColor; [self.contentView addSubview:_line]; _line.sd_layout .leftSpaceToView(self.contentView, 15) .rightSpaceToView(self.contentView, 15) .bottomEqualToView(self.contentView) .heightIs(0.8); } return self; } - (void)assignment:(SystemModel *)model { _time.text = [NSString stringWithFormat:@"提示 %@",model.createTime]; _message.text = model.body; if ([model.isRead isEqualToString:@"0"]) { [_image setImage:[UIImage imageNamed:@"xiwd"]]; }else{ [_image setImage:[UIImage imageNamed:@"xiyd"]]; } } - (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