SelectVCollectionViewCell.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // SelectVCollectionViewCell.m
  3. // Asteria
  4. //
  5. // Created by 王猛 on 2023/5/8.
  6. //
  7. #import "SelectVCollectionViewCell.h"
  8. @interface SelectVCollectionViewCell ()
  9. @end
  10. @implementation SelectVCollectionViewCell
  11. - (instancetype)initWithFrame:(CGRect)frame
  12. {
  13. self = [super initWithFrame:frame];
  14. if (self) {
  15. [self tt_addSubViews];
  16. }
  17. return self;
  18. }
  19. -(void)tt_addSubViews{
  20. UIView *bgView= [[UIView alloc]initWithFrame:self.frame];
  21. bgView.layer.cornerRadius = 8;
  22. bgView.layer.borderColor = [UIColor qmui_colorWithHexString:@"#043632"].CGColor;
  23. bgView.layer.borderWidth =2;
  24. bgView.clipsToBounds = YES;
  25. self.selectedBackgroundView = bgView;
  26. [self.contentView addSubview:self.imgV];
  27. [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) {
  28. make.edges.mas_equalTo(5);
  29. }];
  30. }
  31. - (UIImageView *)imgV {
  32. if (!_imgV) {
  33. _imgV = [[UIImageView alloc] initWithImage:nil];
  34. _imgV.contentMode = UIViewContentModeScaleAspectFill;
  35. _imgV.layer.cornerRadius = 4;
  36. _imgV.clipsToBounds = YES;
  37. }
  38. return _imgV;
  39. }
  40. @end