// // OrdercontentCell.m // jitao // // Created by 罗云飞 on 2017/12/24. // Copyright © 2017年 罗云飞. All rights reserved. // #import "OrdercontentCell.h" @implementation OrdercontentCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { _view = [UIView new]; _view.backgroundColor = [UIColor colorWithString:@"#F8F8F8"]; [self.contentView addSubview:_view]; _content = [UILabel new]; _content.font = NewFont(fitScreenWidth(12)); _content.textColor = [UIColor colorWithString:@"#9A9A9A"]; _content.numberOfLines = 0; [_view addSubview:_content]; _content.sd_layout .topSpaceToView(_view, 5) .autoHeightRatio(0) .leftSpaceToView(_view, 15) .rightSpaceToView(_view, 15); } return self; } - (void)assignment:(OrderdetailModel*)model { CGFloat height = [NewUtils heightforString:model.orderRemarks andWidth:SCREEN_WIDTH-30 fontSize:fitScreenWidth(12)]; _view.sd_layout .leftEqualToView(self.contentView) .topEqualToView(self.contentView) .rightEqualToView(self.contentView) .heightIs(height+30); if ([model.orderRemarks isEqualToString:@""]) { _content.text = @"暂无备注~"; }else{ _content.text = model.orderRemarks; } } - (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