ModelLeftCell.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // ModelLeftCell.m
  3. // JSJPCoach
  4. //
  5. // Created by apple on 2017/3/23.
  6. // Copyright © 2017年 Danson. All rights reserved.
  7. //
  8. #import "ModelLeftCell.h"
  9. @implementation ModelLeftCell
  10. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  11. {
  12. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  13. if (self)
  14. {
  15. self.selectionStyle = UITableViewCellSelectionStyleNone;
  16. self.backgroundColor = [UIColor clearColor];
  17. CGFloat w = 90;
  18. if (kSize.width > 320.0) {
  19. w = 110;
  20. }
  21. self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, w - 20, 25)];
  22. [self.timeLabel setText:@"" Font:Font14 TextColor:RGBA_COLOR(130, 130, 130, 1) Alignment:NSTextAlignmentCenter];
  23. self.timeLabel.highlightedTextColor = RGBA_COLOR(253, 212, 49, 1);
  24. [self.contentView addSubview:self.timeLabel];
  25. self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, w - 20, 25)];
  26. [self.priceLabel setText:@"" Font:Font14 TextColor:RGBA_COLOR(130, 130, 130, 1) Alignment:NSTextAlignmentCenter];
  27. self.priceLabel.highlightedTextColor = RGBA_COLOR(253, 212, 49, 1);
  28. [self.contentView addSubview:self.priceLabel];
  29. self.yellowView = [[UIView alloc] initWithFrame:CGRectMake(0, 5, 5, 50)];
  30. self.yellowView.backgroundColor = RGBA_COLOR(253, 212, 49, 1);
  31. [self.contentView addSubview:self.yellowView];
  32. }
  33. return self;
  34. }
  35. - (void)setSelected:(BOOL)selected animated:(BOOL)animated
  36. {
  37. [super setSelected:selected animated:animated];
  38. // Configure the view for the selected state
  39. // self.contentView.backgroundColor = selected ? [UIColor whiteColor] : [UIColor colorWithWhite:0 alpha:0.1];
  40. self.highlighted = selected;
  41. self.timeLabel.highlighted = selected;
  42. self.priceLabel.highlighted = selected;
  43. self.yellowView.hidden = !selected;
  44. }
  45. @end