猎豆优选

LDLoadAllgoodCell.m 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // LDLoadAllgoodCell.m
  3. // YouHuiProject
  4. //
  5. // Created by liuxueli on 2018/12/14.
  6. // Copyright © 2018 kuxuan. All rights reserved.
  7. //
  8. #import "LDLoadAllgoodCell.h"
  9. @implementation LDLoadAllgoodCell
  10. - (instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. [self initSubView];
  15. }
  16. return self;
  17. }
  18. - (void)initSubView {
  19. self.layer.cornerRadius = 4;
  20. self.layer.masksToBounds = YES;
  21. UIImageView *imgView = [[UIImageView alloc] init];
  22. [self.contentView addSubview:imgView];
  23. imgView.image =[UIImage imageNamed:@"top_all_icon"];
  24. UILabel *titleLb = [[UILabel alloc] init];
  25. titleLb.text = @"更多";
  26. titleLb.font = [UIFont systemFontOfSize:14];
  27. titleLb.textColor = [UIColor YHColorWithHex:0x4A4A4A];
  28. titleLb.textAlignment = NSTextAlignmentCenter;
  29. [self.contentView addSubview:titleLb];
  30. [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.top.mas_equalTo(37.5);
  32. make.width.height.mas_equalTo(FITSIZE(60));
  33. make.centerX.mas_equalTo(self.mas_centerX);
  34. }];
  35. [titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
  36. make.left.right.mas_equalTo(0);
  37. make.height.mas_equalTo(FITSIZE(20));
  38. make.top.mas_equalTo(imgView.mas_bottom).mas_offset(FITSIZE(5));
  39. }];
  40. }
  41. @end