// // SelectVCollectionViewCell.m // Asteria // // Created by 王猛 on 2023/5/8. // #import "SelectVCollectionViewCell.h" @interface SelectVCollectionViewCell () @end @implementation SelectVCollectionViewCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self tt_addSubViews]; } return self; } -(void)tt_addSubViews{ UIView *bgView= [[UIView alloc]initWithFrame:self.frame]; bgView.layer.cornerRadius = 8; bgView.layer.borderColor = [UIColor qmui_colorWithHexString:@"#043632"].CGColor; bgView.layer.borderWidth =2; bgView.clipsToBounds = YES; self.selectedBackgroundView = bgView; [self.contentView addSubview:self.imgV]; [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(5); make.right.mas_equalTo(-5); make.top.mas_equalTo(5); make.bottom.mas_equalTo(-5); }]; } - (UIImageView *)imgV { if (!_imgV) { _imgV = [[UIImageView alloc] initWithImage:nil]; _imgV.contentMode = UIViewContentModeScaleAspectFill; _imgV.layer.cornerRadius = 4; _imgV.clipsToBounds = YES; } return _imgV; } @end