| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- //
- // NewMeassageCell.m
- // jitao
- //
- // Created by 罗云飞 on 2018/9/5.
- // Copyright © 2018年 罗云飞. All rights reserved.
- //
- #import "NewMeassageCell.h"
- @implementation NewMeassageCell
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
-
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- _time = [UILabel new];
- _time.textColor = [UIColor colorWithString:@"#AEAEAE"];
- _time.font = NewFont(fitScreenWidth(14));
- [_time setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_time];
-
- _time.sd_layout
- .leftSpaceToView(self.contentView, 15)
- .heightIs(fitScreenWidth(15))
- .topSpaceToView(self.contentView, 15);
-
- _neirong = [UILabel new];
- _neirong.lineBreakMode = NSLineBreakByTruncatingTail;
- _neirong.numberOfLines = 2;
- _neirong.font = NewFont(fitScreenWidth(16));
- [self.contentView addSubview:_neirong];
-
- _neirong.sd_layout
- .leftEqualToView(_time)
- .rightSpaceToView(self.contentView, 40)
- .maxHeightIs(fitScreenWidth(40))
- .topSpaceToView(_time, 20);
-
- UILabel *line = [UILabel new];
- line.backgroundColor = NewLineGrayColor;
- [self.contentView addSubview:line];
-
- line.sd_layout
- .bottomEqualToView(self.contentView)
- .heightIs(1)
- .widthIs(SCREEN_WIDTH);
- }
- return self;
- }
- - (void)assignment:(NewMeassageModel *)model {
- _time.text = [NewUtils shijian:model.createTime];
- _neirong.text = model.title;
- if ([model.isRead isEqualToString:@"1"]) {
- _neirong.textColor = [UIColor colorWithString:@"#3C3C3C"];
- }else{
- _neirong.textColor = NewRedColor;
- }
- }
- - (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
|