// // QueryFareTableViewCell.m // tongxin // // Created by ArJun on 2018/8/3. // Copyright © 2018年 xTT. All rights reserved. // #import "QueryFareTableViewCell.h" #import "UIView+Extension.h" @implementation QueryFareTableViewCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code self.selectionStyle = UITableViewCellSelectionStyleNone; [self.cententView layerCornerRadius:5 masksToBounds:YES]; } - (void)setModel:(QueryFare *)model { _model = model; self.cententLabel.text = model.content; self.timerLabel.text = [myHelper getDateFormatWithStr:@"MM/dd HH:mm" timeInterval:model.timestampStr]; [self.timerLabel layerCornerRadius:2 masksToBounds:YES]; } // 根绝数据计算cell的高度 - (CGFloat)heightForModel:(QueryFare *)message { [self setModel:message]; [self layoutIfNeeded]; CGFloat cellHeight = [self.cententView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height+80; return cellHeight; } - (CGFloat)getHeight { [self layoutIfNeeded]; return CGRectGetMaxY(self.cententLabel.frame) + 10; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end