SelectCell.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // SelectCell.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/6/23.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "SelectCell.h"
  9. @implementation SelectCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  15. [super setSelected:selected animated:animated];
  16. // Configure the view for the selected state
  17. }
  18. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  19. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  20. // self.selectedBackgroundView = [[UIView alloc]init];
  21. }
  22. return self;
  23. }
  24. - (void)layoutSubviews
  25. {
  26. [super layoutSubviews];
  27. for (UIControl *control in self.subviews) {
  28. if (![control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
  29. continue;
  30. }
  31. for (UIView *subView in control.subviews) {
  32. if (![subView isKindOfClass: [UIImageView class]]) {
  33. continue;
  34. }
  35. //
  36. [subView setValue:COLOR_THEME forKey:@"tintColor"];
  37. // UIImageView *imageView = (UIImageView *)subView;
  38. // if (self.selected) {
  39. // imageView.image = [UIImage imageNamed:@"ic_squSelect_h"]; // 选中时的图片
  40. // } else {
  41. // imageView.image = [UIImage imageNamed:@"ic_squSelect"]; // 未选中时的图片
  42. // }
  43. }
  44. }
  45. }
  46. @end