// // MapBtnTableViewCell.m // tongxin // // Created by ecell on 2023/8/9. // Copyright © 2023 xTT. All rights reserved. // #import "MapBtnTableViewCell.h" @interface MapBtnTableViewCell () @property (nonatomic ,weak) UIImageView *iconImg; @property (nonatomic ,weak) UILabel *titleLabel; @end @implementation MapBtnTableViewCell - (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)setImageName:(NSString *)imageName { _imageName = imageName; self.iconImg.image = ImageName_(imageName); } - (void)setTitleName:(NSString *)titleName { _titleName = titleName; self.titleLabel.text = titleName; } - (void)subCellView { UIImageView *iconImg = [UIImageView new]; self.iconImg = iconImg; [self.contentView addSubview:iconImg]; [iconImg mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.contentView); make.top.equalTo(self.contentView).offset(10); make.height.width.mas_equalTo(30); }]; UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:Font_(10) textColor:KKTextColor text:@"" Radius:0]; self.titleLabel = titleLabel; [self.contentView addSubview:titleLabel]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.contentView); make.top.equalTo(iconImg.mas_bottom).offset(5); }]; } - (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