dkahgld

ZBSliderCell.m 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // ZBSliderCell.m
  3. // ZBProject
  4. //
  5. // Created by 学丽 on 2019/4/8.
  6. // Copyright © 2019 ZB. All rights reserved.
  7. //
  8. #import "ZBSliderCell.h"
  9. @implementation ZBSliderCell
  10. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  11. {
  12. self =[super initWithStyle:style reuseIdentifier:reuseIdentifier];
  13. if (self) {
  14. [self addSubview:self.img];
  15. [self addSubview:self.titleLabel];
  16. [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
  17. make.left.mas_equalTo(27);
  18. make.top.mas_offset(13);
  19. make.width.height.mas_equalTo(22);
  20. }];
  21. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.left.mas_equalTo(self.img.mas_right).offset(15);
  23. make.top.mas_offset(14);
  24. make.height.mas_equalTo(22);
  25. }];
  26. }
  27. return self;
  28. }
  29. -(UIImageView *)img
  30. {
  31. if (!_img) {
  32. _img =[[UIImageView alloc]init];
  33. _img.image=[UIImage imageNamed:@""];
  34. }
  35. return _img;
  36. }
  37. -(UILabel *)titleLabel
  38. {
  39. if (!_titleLabel) {
  40. _titleLabel=[[UILabel alloc]init];
  41. _titleLabel.textColor=[UIColor YHColorWithHex:0x333333];
  42. _titleLabel.text=@"";
  43. _titleLabel.font=[UIFont systemFontOfSize:16];
  44. }
  45. return _titleLabel;
  46. }
  47. @end