TDTableView.m 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // TDTableView.m
  3. // TheoryNetwork
  4. //
  5. // Created by tederen on 2019/9/23.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "TDTableView.h"
  9. @implementation TDTableView
  10. - (instancetype)init
  11. {
  12. self = [super init];
  13. if (self) {
  14. [self setShowsVerticalScrollIndicator:NO];
  15. [self setShowsHorizontalScrollIndicator:NO];
  16. [self setScrollsToTop:NO];
  17. [self setSeparatorStyle:UITableViewCellSeparatorStyleNone];
  18. self.estimatedRowHeight = 0;
  19. self.estimatedSectionHeaderHeight = 0;
  20. self.estimatedSectionFooterHeight = 0;
  21. }
  22. return self;
  23. }
  24. - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
  25. self = [super initWithFrame:frame style:style];
  26. if (self) {
  27. self.backgroundColor = [UIColor whiteColor];
  28. [self setShowsVerticalScrollIndicator:NO];
  29. [self setShowsHorizontalScrollIndicator:NO];
  30. [self setSeparatorStyle:UITableViewCellSeparatorStyleNone];
  31. self.estimatedRowHeight = 0;
  32. self.estimatedSectionHeaderHeight = 0;
  33. self.estimatedSectionFooterHeight = 0;
  34. }
  35. return self;
  36. }
  37. - (void)setTopInsertValue:(CGFloat)value
  38. {
  39. self.contentInset = UIEdgeInsetsMake(value, 0, 0, 0);
  40. }
  41. @end