// // JXnMyCell.m // shiku_im // // Created by 123 on 2020/5/15. // Copyright © 2020 Reese. All rights reserved. // #import "JXnMyCell.h" @interface JXnMyCell() @property (nonatomic,weak) UIImageView *leftIMG; @property (nonatomic,weak) UILabel *leftLab; @property (nonatomic,weak) UILabel *rightL; @end @implementation JXnMyCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) { UIImageView *leftIMG=[[UIImageView alloc]init]; leftIMG.image=[UIImage imageNamed:@"组20"]; [self.contentView addSubview:leftIMG]; self.leftIMG=leftIMG; /* */ [leftIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self.contentView.mas_centerY); make.left.mas_equalTo(15); }]; UILabel *leftLab=[[UILabel alloc]init]; leftLab.text=@"我的奖品"; leftLab.textColor=kRGBColor51; leftLab.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular]; [self.contentView addSubview:leftLab]; self.leftLab=leftLab; [leftLab mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self.contentView.mas_centerY); make.left.mas_equalTo(leftIMG.mas_right).mas_offset(10); }]; UIImageView *rightIMG=[[UIImageView alloc]init]; rightIMG.image=[UIImage imageNamed:@"组20"]; [self.contentView addSubview:rightIMG]; [rightIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self.contentView.mas_centerY); make.right.mas_equalTo(-15); }]; UILabel *rightL=[[UILabel alloc]init]; rightL.text=@"奖品兑换、奖品记录、推荐奖金"; rightL.textColor=kRGBColor151; rightL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular]; [self.contentView addSubview:rightL]; self.rightL=rightL; [rightL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self.contentView.mas_centerY); make.right.mas_equalTo(rightIMG.mas_left).mas_offset(-10); }]; } return self; } + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *ID = @"JXnMyCell"; JXnMyCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (!cell) { cell = [[JXnMyCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID]; cell.selectionStyle=UITableViewCellSelectionStyleNone; } // cell.selectionStyle=UITableViewCellAccessoryDisclosureIndicator; return cell; } -(void)setModeL:(StatusesModel *)modeL{ _modeL=modeL; self.leftIMG.image=[UIImage imageNamed:modeL.leftIMG]; self.leftLab.text=modeL.text; self.rightL.text=modeL.subtile; } -(void)setFrame:(CGRect)frame{ frame.origin.y+=10; frame.size.height-=10; [super setFrame:frame]; } @end