Nessuna descrizione

KXRecommendCollectionViewCell.m 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // KXRecommendCollectionViewCell.m
  3. // CAISHEN
  4. //
  5. // Created by kuxuan on 2017/8/28.
  6. // Copyright © 2017年 kuxuan. All rights reserved.
  7. //
  8. #import "KXRecommendCollectionViewCell.h"
  9. @implementation KXRecommendCollectionViewCell
  10. - (id)initWithFrame:(CGRect)frame
  11. {
  12. if (self = [super initWithFrame:frame]) {
  13. [self setupUI];
  14. }
  15. return self;
  16. }
  17. - (void)setupUI
  18. {
  19. self.imageView = [[UIImageView alloc]init];
  20. self.imageView.layer.cornerRadius = 8;
  21. self.imageView.layer.masksToBounds = YES;
  22. [self.contentView addSubview:self.imageView];
  23. self.titleLabel = [[UILabel alloc]init];
  24. self.titleLabel.textColor = [UIColor titleColor];
  25. self.titleLabel.textAlignment = NSTextAlignmentCenter;
  26. self.titleLabel.font = FONT_SYS(12);
  27. [self.contentView addSubview:self.titleLabel];
  28. [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.left.equalTo(self.contentView.mas_left).offset(14*SCREEN_MUTI);
  30. make.top.equalTo(self.contentView.mas_top).offset(10*SCREEN_MUTI);
  31. make.size.mas_equalTo(CGSizeMake(50*SCREEN_MUTI, 50*SCREEN_MUTI));
  32. }];
  33. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.left.equalTo(self.contentView);
  35. make.right.equalTo(self.contentView);
  36. make.bottom.equalTo(self.contentView.mas_bottom).offset(-10*SCREEN_MUTI);
  37. }];
  38. }
  39. @end