// // RailSearchAddressTableViewCell.m // LekangGuard // // Created by ecell on 2022/12/13. // #import "RailSearchAddressTableViewCell.h" @interface RailSearchAddressTableViewCell () /// 地址 @property (nonatomic ,weak) UILabel *addressLabel; @end @implementation RailSearchAddressTableViewCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.selectionStyle = UITableViewCellSelectionStyleNone; self.backgroundColor = KKClearColor; [self subCellView]; } return self; } - (void)setAddressStr:(NSString *)addressStr { _addressStr = addressStr; self.addressLabel.text = addressStr; } - (void)subCellView { UIImageView *iconImg = [UICommon ui_imageView:CGRectZero fileName:@"icon_positioning_search"]; [self.contentView addSubview:iconImg]; [iconImg mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(15); make.centerY.equalTo(self.contentView); make.size.mas_equalTo(CGSizeMake(Adapted(iconImg.image.size.width), Adapted(iconImg.image.size.height))); }]; /// 地址 UILabel *addressLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(14) textColor:KKTextBlackColor text:@"" Radius:0]; self.addressLabel = addressLabel; [self.contentView addSubview:addressLabel]; [addressLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(iconImg.mas_right).offset(10); make.right.equalTo(self.contentView.mas_right).inset(15); make.top.equalTo(self.contentView.mas_top).offset(15); make.bottom.equalTo(self.contentView.mas_bottom).inset(15); }]; } - (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