// // ModelLeftCell.m // JSJPCoach // // Created by apple on 2017/3/23. // Copyright © 2017年 Danson. All rights reserved. // #import "ModelLeftCell.h" @implementation ModelLeftCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.selectionStyle = UITableViewCellSelectionStyleNone; self.backgroundColor = [UIColor clearColor]; CGFloat w = 90; if (kSize.width > 320.0) { w = 110; } self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, w - 20, 25)]; [self.timeLabel setText:@"" Font:Font14 TextColor:RGBA_COLOR(130, 130, 130, 1) Alignment:NSTextAlignmentCenter]; self.timeLabel.highlightedTextColor = RGBA_COLOR(253, 212, 49, 1); [self.contentView addSubview:self.timeLabel]; self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, w - 20, 25)]; [self.priceLabel setText:@"" Font:Font14 TextColor:RGBA_COLOR(130, 130, 130, 1) Alignment:NSTextAlignmentCenter]; self.priceLabel.highlightedTextColor = RGBA_COLOR(253, 212, 49, 1); [self.contentView addSubview:self.priceLabel]; self.yellowView = [[UIView alloc] initWithFrame:CGRectMake(0, 5, 5, 50)]; self.yellowView.backgroundColor = RGBA_COLOR(253, 212, 49, 1); [self.contentView addSubview:self.yellowView]; } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state // self.contentView.backgroundColor = selected ? [UIColor whiteColor] : [UIColor colorWithWhite:0 alpha:0.1]; self.highlighted = selected; self.timeLabel.highlighted = selected; self.priceLabel.highlighted = selected; self.yellowView.hidden = !selected; } @end