JXnOhterCell.m 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // JXnMyCell.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/15.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXnOhterCell.h"
  9. @interface JXnOhterCell()
  10. @property (nonatomic,weak) UIImageView *leftIMG;
  11. @property (nonatomic,weak) UILabel *rightL;
  12. @property (nonatomic,weak) UILabel *subTitleL;
  13. @end
  14. @implementation JXnOhterCell
  15. - (void)awakeFromNib {
  16. [super awakeFromNib];
  17. // Initialization code
  18. }
  19. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  20. if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  21. UIImageView *leftIMG=[[UIImageView alloc]init];
  22. [self.contentView addSubview:leftIMG];
  23. self.leftIMG=leftIMG;
  24. [leftIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  26. make.left.mas_equalTo(15);
  27. }];
  28. UILabel *rightL=[[UILabel alloc]init];
  29. rightL.text=@"玩彩必看";
  30. rightL.textColor=kRGBColor51;
  31. rightL.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
  32. [self.contentView addSubview:rightL];
  33. self.rightL=rightL;
  34. [rightL mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  36. make.left.mas_equalTo(leftIMG.mas_right).mas_equalTo(10);
  37. }];
  38. UIImageView *rightIMG=[[UIImageView alloc]init];
  39. rightIMG.image=[UIImage imageNamed:@"组20"];
  40. [self.contentView addSubview:rightIMG];
  41. [rightIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  43. make.right.mas_equalTo(-15);
  44. }];
  45. UILabel *subTitleL=[[UILabel alloc]init];
  46. subTitleL.text=@"奖品兑换、奖品记录、推荐奖金";
  47. subTitleL.textColor=kRGBColor151;
  48. subTitleL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
  49. [self.contentView addSubview:subTitleL];
  50. self.subTitleL=subTitleL;
  51. [subTitleL mas_makeConstraints:^(MASConstraintMaker *make) {
  52. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  53. make.right.mas_equalTo(rightIMG.mas_left).mas_offset(-10);
  54. }];
  55. UIView *line_View=[[UIView alloc]init];
  56. line_View.backgroundColor=kRGBColor(246, 246, 246);
  57. [self.contentView addSubview:line_View];
  58. line_View.hidden=NO;
  59. self.line_View=line_View;
  60. [line_View mas_makeConstraints:^(MASConstraintMaker *make) {
  61. make.bottom.mas_equalTo(self.contentView.mas_bottom);
  62. make.left.mas_equalTo(15);
  63. make.right.mas_equalTo(-15);
  64. make.height.mas_equalTo(1);
  65. }];
  66. }
  67. return self;
  68. }
  69. + (instancetype)cellWithTableView:(UITableView *)tableView
  70. {
  71. static NSString *ID = @"JXnOhterCell";
  72. JXnOhterCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  73. if (!cell) {
  74. cell = [[JXnOhterCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  75. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  76. }
  77. // cell.selectionStyle=UITableViewCellAccessoryDisclosureIndicator;
  78. return cell;
  79. }
  80. -(void)setModeL:(AdsModel *)modeL{
  81. _modeL=modeL;
  82. self.leftIMG.image=[UIImage imageNamed:modeL.leftIMG];
  83. self.rightL.text=modeL.text;
  84. self.subTitleL.text=modeL.subtile;
  85. }
  86. @end