123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- //
- // JXMyFeedCell.m
- // shiku_im
- //
- // Created by 123 on 2020/5/23.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXMyFeedCell.h"
- @interface JXMyFeedCell()
- @property (nonatomic,weak) UIImageView *leftIMG;
- @property (nonatomic,weak) UILabel *rightL;
- @property (nonatomic,weak) UILabel *subTitleL;
- @end
- @implementation JXMyFeedCell
-
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
-
- if (selected) {
- self.rightL.textColor=kRGBColor(222, 29, 19);
- self.leftIMG.image=[UIImage imageNamed:@"yjduigou"];
- }else{
-
- self.rightL.textColor=kRGBColor51;
- self.leftIMG.image=[UIImage imageNamed:@""];
-
- }
- }
-
- -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
-
-
- 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(15);
- }];
-
- UIImageView *rightIMG=[[UIImageView alloc]init];
- //rightIMG.image=[UIImage imageNamed:@""];
- [self.contentView addSubview:rightIMG];
- self.leftIMG=rightIMG;
- [rightIMG mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(self.contentView.mas_centerY);
- make.right.mas_equalTo(-15);
- }];
- /*
- 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 = @"JXMyFeedCell";
- JXMyFeedCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
-
- if (!cell) {
- cell = [[JXMyFeedCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
- cell.selectionStyle=UITableViewCellSelectionStyleNone;
- //cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
- }
-
-
- return cell;
- }
-
- - (void)cellWModel:(JXMyModel *)model index:(NSIndexPath *)index{
-
- _model=model;
- if (index.row==0) {
- self.rightL.textColor=kRGBColor(222, 29, 19);
- self.leftIMG.image=[UIImage imageNamed:@"yjduigou"];
- }else{
-
-
- self.rightL.textColor=kRGBColor51;
- self.leftIMG.image=[UIImage imageNamed:@""];
- }
-
-
- }
- -(void)setModel:(JXMyModel *)model{
- _model=model;
-
- self.rightL.text=model.name;
-
- }
- @end
|