// // ASCategaryCollectCell.m // Asteria // // Created by iOS on 2023/6/6. // #import "ASCategaryCollectCell.h" @implementation ASCategaryCollectCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self loadSubV]; } return self; } - (void)loadSubV { self.contentView.backgroundColor = UIColor.whiteColor; [self.contentView addSubview:self.imgV]; [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.contentView); make.width.height.equalTo(@112); }]; [self.contentView addSubview:self.titleLb]; [self.titleLb mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.equalTo(self.contentView).offset(-16); make.leading.equalTo(self.contentView).offset(18); make.trailing.equalTo(self.contentView).offset(-18); }]; } - (UIImageView *)imgV { if (!_imgV) { UIImageView *imgV = [UIImageView baseImgV]; imgV.contentMode = UIViewContentModeScaleAspectFill; imgV.clipsToBounds = true; imgV.layer.cornerRadius = 56; imgV.layer.masksToBounds = true; _imgV = imgV; } return _imgV; } - (UILabel *)titleLb { if (!_titleLb) { UILabel *lb = [UILabel baseLb]; lb.textColor = Col_FFF; lb.font = [UIFont fontWithName:Rob_Bold size:12]; lb.textAlignment = NSTextAlignmentCenter; lb.numberOfLines = 2; _titleLb = lb; } return _titleLb; } @end