SearchCell.m 930 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // SearchCell.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2020/1/2.
  6. // Copyright © 2020 tederen. All rights reserved.
  7. //
  8. #import "SearchCell.h"
  9. @implementation SearchCell
  10. - (instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. [self.contentView addSubview:self.titleL];
  15. self.contentView.backgroundColor = UIColorHex(#F5F5F5);
  16. self.contentView.layer.cornerRadius = 4.f;
  17. self.contentView.layer.masksToBounds = YES;
  18. [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  19. make.edges.mas_offset(UIEdgeInsetsZero);
  20. }];
  21. self.titleL.textAlignment = NSTextAlignmentCenter;
  22. }
  23. return self;
  24. }
  25. - (UILabel *)titleL
  26. {
  27. if (!_titleL) {
  28. _titleL = [UILabel new];
  29. _titleL.font = [UIFont systemFontOfSize:13];
  30. _titleL.textColor = UIColorHex(#858585);
  31. }
  32. return _titleL;
  33. }
  34. @end