Nenhuma Descrição

KXMainDetailTableViewCell.m 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // KXMainDetailTableViewCell.m
  3. // QBCS
  4. //
  5. // Created by kuxuan on 2017/6/6.
  6. // Copyright © 2017年 kuxuan. All rights reserved.
  7. //
  8. #import "KXMainDetailTableViewCell.h"
  9. @implementation KXMainDetailTableViewCell
  10. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  11. {
  12. if (self==[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  13. [self setupUI];
  14. }
  15. return self;
  16. }
  17. -(void)setupUI
  18. {
  19. self.ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 14, 20, 20)];
  20. [self.contentView addSubview:self.ImageView];
  21. self.nameLabel=[[UILabel alloc]init];
  22. self.nameLabel.textColor=[UIColor detailTitleColor];
  23. self.nameLabel.font=FONT_SYS(14);
  24. self.nameLabel.numberOfLines=1;
  25. [self.contentView addSubview:self.nameLabel];
  26. self.contentLabel=[[UILabel alloc]init];
  27. self.contentLabel.font=FONT_SYS(14);
  28. self.contentLabel.preferredMaxLayoutWidth=SCREEN_WIDTH-2*LEADING_SPACE;
  29. [self.contentLabel sizeToFit];
  30. self.contentLabel.textColor=[UIColor titleColor];
  31. self.contentLabel.numberOfLines=0;
  32. [self.contentView addSubview:self.contentLabel];
  33. [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.left.equalTo(self.ImageView.mas_right).offset(10);
  35. make.top.equalTo(self.ImageView.mas_top);
  36. }];
  37. [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.left.equalTo(self.contentView.mas_left).offset(LEADING_SPACE);
  39. make.top.equalTo(self.contentView.mas_top).offset(42);
  40. }];
  41. self.lineLabel = [[UILabel alloc]init];
  42. self.lineLabel.backgroundColor = [UIColor lineColor];
  43. [self.contentView addSubview:self.lineLabel];
  44. // [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  45. // make.left.equalTo(self.contentView);
  46. // make.right.equalTo(self.contentView);
  47. // make.height.mas_equalTo(0.5);
  48. // make.top.equalTo(self.contentView);
  49. // }];
  50. }
  51. @end