TopicGroupManageCell.m 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // TopicGroupManageCell.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2019/12/18.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "TopicGroupManageCell.h"
  9. @implementation TopicGroupManageCell
  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. + (TopicGroupManageCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
  19. static NSString *cellIdentifer = @"TopicGroupManageCell0";
  20. TopicGroupManageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
  21. if (cell == nil || !cell) {
  22. cell = [[[NSBundle mainBundle] loadNibNamed:@"TopicGroupManageCell" owner:nil options:nil] objectAtIndex:0];
  23. }
  24. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  25. return cell;
  26. }
  27. + (TopicGroupManageCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
  28. static NSString *cellIdentifer = @"TopicGroupManageCell1";
  29. TopicGroupManageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
  30. if (cell == nil || !cell) {
  31. cell = [[[NSBundle mainBundle] loadNibNamed:@"TopicGroupManageCell" owner:nil options:nil] objectAtIndex:1];
  32. }
  33. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  34. return cell;
  35. }
  36. - (void)layoutSubviews
  37. {
  38. for (UIView *supView in self.subviews){
  39. if ([supView isKindOfClass:NSClassFromString(@"UITableViewCellReorderControl")]){
  40. for (UIView *view in supView.subviews)
  41. {
  42. if ([view isKindOfClass: [UIImageView class]])
  43. {
  44. UIImageView * imagV = (UIImageView *)view;
  45. [imagV setFrame:CGRectMake(0, 0, 22, 18)];
  46. imagV.center = supView.center;
  47. imagV.contentMode = UIViewContentModeCenter;
  48. imagV.image = [UIImage imageNamed: @"list_sort"];
  49. UILabel * label = [UILabel new];
  50. label.backgroundColor = UIColorHex(#EAEAEA);
  51. [supView addSubview:label];
  52. [label setFrame:CGRectMake(0, supView.frame.size.height - 0.5, supView.frame.size.width, 0.5)];
  53. }else{
  54. [view removeFromSuperview];
  55. }
  56. }
  57. }
  58. }
  59. [super layoutSubviews];
  60. }
  61. @end