JXGuanFCeshiCell.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // JXGuanFCeshiCell.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/4/28.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXGuanFCeshiCell.h"
  9. #import "UIView+LK.h"
  10. @interface JXGuanFCeshiCell()
  11. @property (nonatomic, strong)UIImageView *IMGHead;
  12. @property (nonatomic, weak)UILabel *contentL;
  13. @end
  14. @implementation JXGuanFCeshiCell
  15. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  16. if(self= [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
  17. self.IMGHead = [[UIImageView alloc] init];
  18. self.IMGHead.image = [UIImage imageNamed:@""];
  19. [self addSubview:self.IMGHead];
  20. [self.IMGHead mas_makeConstraints:^(MASConstraintMaker *make) {
  21. make.centerY.mas_equalTo(self.centerY).mas_offset(0);
  22. make.left.mas_equalTo(10);
  23. }];
  24. UILabel *contentL = [[UILabel alloc]init];
  25. contentL.font=[UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
  26. contentL.textColor=[UIColor blackColor];
  27. contentL.textAlignment=NSTextAlignmentLeft;
  28. contentL.numberOfLines=3;
  29. [self addSubview:contentL];
  30. self.contentL=contentL;
  31. [self.contentL mas_makeConstraints:^(MASConstraintMaker *make) {
  32. make.left.mas_equalTo(self.IMGHead.mas_right).mas_offset(15);
  33. make.centerY.mas_equalTo(self.IMGHead.centerY).mas_offset(0);
  34. }];
  35. UIView *line_view = [[UIView alloc]init];
  36. line_view.backgroundColor=[UIColor lightGrayColor];
  37. [self addSubview:line_view];
  38. [self.contentL mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.left.mas_equalTo(50);
  40. make.right.mas_equalTo(0);
  41. make.bottom.mas_equalTo(0);
  42. make.height.mas_equalTo(1);
  43. }];
  44. }
  45. return self;
  46. }
  47. +(instancetype)cellWithTableView:(UITableView *)tableView{
  48. static NSString *ID = @"JXGuanFCeshiCell";
  49. JXGuanFCeshiCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  50. if (cell == nil) {
  51. cell = [[JXGuanFCeshiCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
  52. }
  53. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  54. return cell;
  55. }
  56. @end