// // MapMessageCustomCell.m // EscortProject // // Created by 仁康信息 on 2023/7/7. // #import "MapMessageCustomCell.h" @implementation MapMessageCustomCell - (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 } - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.container.layer.cornerRadius = 10; self.container.backgroundColor = UIColor.whiteColor; self.myTextLabel = [[UILabel alloc] init]; self.myTextLabel.textAlignment = NSTextAlignmentLeft; self.myTextLabel.font = [UIFont systemFontOfSize:14]; self.myTextLabel.backgroundColor = UIColor.whiteColor; [self.container addSubview:self.myTextLabel]; self.mapImage = [[UIImageView alloc] init]; [self.container addSubview:self.mapImage]; } return self; } // 根据 cellData 绘制 cell - (void)fillWithData:(MapMessageCustomCellData *)data; { [super fillWithData:data]; self.myTextLabel.text = @" 位置"; [self.mapImage sd_setImageWithURL:[NSURL URLWithString:data.MapPictureImg] placeholderImage:nil]; } // 设置控件坐标 - (void)layoutSubviews { [super layoutSubviews]; self.myTextLabel.mm_right(0).mm_top(0).mm_left(0).mm_height(30).mm_width(245); self.mapImage.mm_top(self.myTextLabel.mm_y + 30 ).mm_width(245).mm_height(140); } @end