ASVipCenterCollectCell.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // ASVipCenterCollectCell.m
  3. // Asteria
  4. //
  5. // Created by iOS on 2023/6/27.
  6. //
  7. #import "ASVipCenterCollectCell.h"
  8. @interface ASVipCenterCollectCell ()
  9. @property (nonatomic, strong) UIImageView *imgV;
  10. @end
  11. @implementation ASVipCenterCollectCell
  12. - (void)setData:(NSString *)imgName desStr:(NSString *)desStr {
  13. self.imgV.image = [UIImage imageNamed:imgName];
  14. self.desLb.text = desStr;
  15. }
  16. - (instancetype)initWithFrame:(CGRect)frame {
  17. self = [super initWithFrame:frame];
  18. if (self) {
  19. [self addSubview:self.imgV];
  20. [self addSubview:self.desLb];
  21. [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.leading.equalTo(self).offset(20);
  23. make.trailing.equalTo(self).offset(-20);
  24. make.top.bottom.equalTo(self);
  25. }];
  26. [self.desLb mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.trailing.equalTo(self.imgV).offset(-24);
  28. make.leading.greaterThanOrEqualTo(self.imgV).offset(24);
  29. make.bottom.equalTo(self.imgV).offset(-24);
  30. make.height.equalTo(@17);
  31. }];
  32. }
  33. return self;
  34. }
  35. - (UIImageView *)imgV {
  36. if (!_imgV) {
  37. UIImageView *v = [UIImageView baseImgV];
  38. _imgV = v;
  39. }
  40. return _imgV;
  41. }
  42. - (UILabel *)desLb {
  43. if (!_desLb) {
  44. UILabel *lb = [UILabel baseLb];
  45. lb.font = [UIFont fontWithName:Rob_BoldItalic size:14];
  46. lb.textColor = Col_000;
  47. lb.textAlignment = NSTextAlignmentRight;
  48. _desLb = lb;
  49. }
  50. return _desLb;
  51. }
  52. @end