JXnMyCell.m 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 "JXnMyCell.h"
  9. @interface JXnMyCell()
  10. @property (nonatomic,weak) UIImageView *leftIMG;
  11. @property (nonatomic,weak) UILabel *leftLab;
  12. @property (nonatomic,weak) UILabel *rightL;
  13. @end
  14. @implementation JXnMyCell
  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. leftIMG.image=[UIImage imageNamed:@"组20"];
  23. [self.contentView addSubview:leftIMG];
  24. self.leftIMG=leftIMG;
  25. /*
  26. */
  27. [leftIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  28. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  29. make.left.mas_equalTo(15);
  30. }];
  31. UILabel *leftLab=[[UILabel alloc]init];
  32. leftLab.text=@"我的奖品";
  33. leftLab.textColor=kRGBColor51;
  34. leftLab.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
  35. [self.contentView addSubview:leftLab];
  36. self.leftLab=leftLab;
  37. [leftLab mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  39. make.left.mas_equalTo(leftIMG.mas_right).mas_offset(10);
  40. }];
  41. UIImageView *rightIMG=[[UIImageView alloc]init];
  42. rightIMG.image=[UIImage imageNamed:@"组20"];
  43. [self.contentView addSubview:rightIMG];
  44. [rightIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  45. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  46. make.right.mas_equalTo(-15);
  47. }];
  48. UILabel *rightL=[[UILabel alloc]init];
  49. rightL.text=@"奖品兑换、奖品记录、推荐奖金";
  50. rightL.textColor=kRGBColor151;
  51. rightL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
  52. [self.contentView addSubview:rightL];
  53. self.rightL=rightL;
  54. [rightL mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  56. make.right.mas_equalTo(rightIMG.mas_left).mas_offset(-10);
  57. }];
  58. }
  59. return self;
  60. }
  61. + (instancetype)cellWithTableView:(UITableView *)tableView
  62. {
  63. static NSString *ID = @"JXnMyCell";
  64. JXnMyCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  65. if (!cell) {
  66. cell = [[JXnMyCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  67. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  68. }
  69. // cell.selectionStyle=UITableViewCellAccessoryDisclosureIndicator;
  70. return cell;
  71. }
  72. -(void)setModeL:(StatusesModel *)modeL{
  73. _modeL=modeL;
  74. self.leftIMG.image=[UIImage imageNamed:modeL.leftIMG];
  75. self.leftLab.text=modeL.text;
  76. self.rightL.text=modeL.subtile;
  77. }
  78. -(void)setFrame:(CGRect)frame{
  79. frame.origin.y+=10;
  80. frame.size.height-=10;
  81. [super setFrame:frame];
  82. }
  83. @end