// // JXnMyCell.m // shiku_im // // Created by 123 on 2020/5/15. // Copyright © 2020 Reese. All rights reserved. // #import "JXnOhterCell.h" @interface JXnOhterCell() @property (nonatomic,weak) UIImageView *leftIMG; @property (nonatomic,weak) UILabel *rightL; @property (nonatomic,weak) UILabel *subTitleL; @end @implementation JXnOhterCell - (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]; [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 *rightL=[[UILabel alloc]init]; rightL.text=@"玩彩必看"; rightL.textColor=kRGBColor51; rightL.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular]; [self.contentView addSubview:rightL]; self.rightL=rightL; [rightL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self.contentView.mas_centerY); make.left.mas_equalTo(leftIMG.mas_right).mas_equalTo(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 *subTitleL=[[UILabel alloc]init]; subTitleL.text=@"奖品兑换、奖品记录、推荐奖金"; subTitleL.textColor=kRGBColor151; subTitleL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular]; [self.contentView addSubview:subTitleL]; self.subTitleL=subTitleL; [subTitleL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self.contentView.mas_centerY); make.right.mas_equalTo(rightIMG.mas_left).mas_offset(-10); }]; UIView *line_View=[[UIView alloc]init]; line_View.backgroundColor=kRGBColor(246, 246, 246); [self.contentView addSubview:line_View]; line_View.hidden=NO; self.line_View=line_View; [line_View mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.mas_equalTo(self.contentView.mas_bottom); make.left.mas_equalTo(15); make.right.mas_equalTo(-15); make.height.mas_equalTo(1); }]; } return self; } + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *ID = @"JXnOhterCell"; JXnOhterCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (!cell) { cell = [[JXnOhterCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID]; cell.selectionStyle=UITableViewCellSelectionStyleNone; } // cell.selectionStyle=UITableViewCellAccessoryDisclosureIndicator; return cell; } -(void)setModeL:(AdsModel *)modeL{ _modeL=modeL; self.leftIMG.image=[UIImage imageNamed:modeL.leftIMG]; self.rightL.text=modeL.text; self.subTitleL.text=modeL.subtile; } @end