// // RankingListTableViewCell.m // tongxin // // Created by WeiChaoZheng on 2018/8/24. // Copyright © 2018年 xTT. All rights reserved. // #import "RankingListTableViewCell.h" #import "Step.h" @implementation RankingListTableViewCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code self.listIdentLabel.backgroundColor = [UIColor clearColor]; self.listIdentLabel.textColor = RGB(100, 101, 102); // self.listIdentLabel.layer.cornerRadius = 10; // self.listIdentLabel.layer.masksToBounds = YES; self.listIdentLabel.adjustsFontSizeToFitWidth = YES; self.deviceImageView.layer.cornerRadius = 20; self.deviceImageView.layer.masksToBounds = YES; self.stepNumLabel.textColor = mainColor; self.selectionStyle = UITableViewCellSelectionStyleNone; self.nameLabel.numberOfLines = 1;//指定有1行 self.backgroundColor = [UIColor clearColor]; self.contentView.backgroundColor = [UIColor clearColor]; } -(void)setLineViewHidden:(BOOL)isHidden{ [self.lineView setHidden:isHidden]; // UIRectCorner corners = UIRectCornerBottomRight | UIRectCornerBottomLeft; // if(isHidden){ // [self setBorderWithCornerRadius:5 borderWidth:0 borderColor:[UIColor clearColor] type:corners]; // }else{ // [self setBorderWithCornerRadius:0 borderWidth:0 borderColor:[UIColor clearColor] type:corners]; // } } -(void)setDataWith:(Step*)step{ self.stepNumLabel.text = [NSString stringWithFormat:@"%@步",step.num]; // [self setImageView:self.deviceImageView WithStepModel:step]; if(step.avator != nil && [step.avator containsString:@"http"]){ [self.deviceImageView sd_setImageWithURL:[NSURL URLWithString:step.avator] placeholderImage:[UIImage imageNamed:@"设备默认头像"]]; }else{ self.deviceImageView.image = [UIImage imageNamed:@"设备默认头像"]; } [self.listIdentLabel setHidden:NO]; self.listIdentLabel.text = [NSString stringWithFormat:@"%@",step.my_ranking]; //排名 self.nameLabel.text = step.name; } //-(void)setImageView:(UIImageView*)imageView WithStepModel:(Step*)data{ // if(data.avator && ![data.avator containsString:@"default.jpg"]){ // [imageView sd_setImageWithURL:[NSURL URLWithString:data.avator]]; // }else{ // //判断性别 // NSString *sexImageName ; // if([data.sex isEqualToString:@"girl"]){ // //女 // sexImageName = @"icon_girl_head_portrait"; // }else{ // //男 // sexImageName = @"icon_boy_head_portrait"; // } // imageView.image = [UIImage imageNamed:sexImageName]; // } //} - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end