GKPageScrollView.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. //
  2. // GKPageScrollView.m
  3. // GKPageScrollView
  4. //
  5. // Created by QuintGao on 2018/10/26.
  6. // Copyright © 2018 QuintGao. All rights reserved.
  7. //
  8. #import "GKPageScrollView.h"
  9. #import "GKPageDefine.h"
  10. @interface GKPageScrollView()<UITableViewDataSource, UITableViewDelegate, GKPageListContainerViewDelegate>
  11. @property (nonatomic, strong) GKPageTableView *mainTableView;
  12. @property (nonatomic, strong) GKPageListContainerView *listContainerView;
  13. @property (nonatomic, weak) id<GKPageScrollViewDelegate> delegate;
  14. // 列表存储
  15. @property (nonatomic, strong) NSMutableDictionary <NSNumber *, id<GKPageListViewDelegate>> *validListDict;
  16. // 包裹segmentedView和列表容器的view
  17. @property (nonatomic, weak) UIView *pageView;
  18. // 当前滑动的listView
  19. @property (nonatomic, weak) UIScrollView *currentListScrollView;
  20. // 是否滑动到临界点,可有偏差
  21. @property (nonatomic, assign) BOOL isCriticalPoint;
  22. // 是否到达临界点,无偏差
  23. @property (nonatomic, assign) BOOL isCeilPoint;
  24. // mainTableView是否可滑动
  25. @property (nonatomic, assign) BOOL isMainCanScroll;
  26. // listScrollView是否可滑动
  27. @property (nonatomic, assign) BOOL isListCanScroll;
  28. // 是否开始拖拽,只有在拖拽中才去处理滑动,解决使用mj_header可能出现的bug
  29. @property (nonatomic, assign) BOOL isBeginDragging;
  30. // 快速切换原点和临界点
  31. @property (nonatomic, assign) BOOL isScrollToOriginal;
  32. @property (nonatomic, assign) BOOL isScrollToCritical;
  33. // 是否加载
  34. @property (nonatomic, assign) BOOL isLoaded;
  35. // headerView的高度
  36. @property (nonatomic, assign) CGFloat headerHeight;
  37. // 临界点
  38. @property (nonatomic, assign) CGFloat criticalPoint;
  39. @property (nonatomic, assign) CGPoint criticalOffset;
  40. @end
  41. @implementation GKPageScrollView
  42. - (instancetype)initWithDelegate:(id<GKPageScrollViewDelegate>)delegate {
  43. if (self = [super initWithFrame:CGRectZero]) {
  44. self.delegate = delegate;
  45. self.ceilPointHeight = GKPAGE_NAVBAR_HEIGHT;
  46. self.validListDict = [NSMutableDictionary new];
  47. [self initSubviews];
  48. }
  49. return self;
  50. }
  51. - (void)layoutSubviews {
  52. [super layoutSubviews];
  53. if (CGRectEqualToRect(self.mainTableView.frame, self.bounds)) return;
  54. self.mainTableView.frame = self.bounds;
  55. if (!self.isLoaded) return;
  56. if (self.isShowInFooter) {
  57. self.mainTableView.tableFooterView = [self getPageView];
  58. }else {
  59. [self.mainTableView reloadData];
  60. }
  61. }
  62. - (void)initSubviews {
  63. self.isCriticalPoint = NO;
  64. self.isMainCanScroll = YES;
  65. self.isListCanScroll = NO;
  66. self.mainTableView = [[GKPageTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  67. self.mainTableView.dataSource = self;
  68. self.mainTableView.delegate = self;
  69. self.mainTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  70. self.mainTableView.showsVerticalScrollIndicator = NO;
  71. self.mainTableView.showsHorizontalScrollIndicator = NO;
  72. [self.mainTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
  73. if (@available(iOS 11.0, *)) {
  74. self.mainTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  75. }
  76. if (@available(iOS 15.0, *)) {
  77. [self.mainTableView setValue:@(0) forKey:@"sectionHeaderTopPadding"];
  78. }
  79. [self addSubview:self.mainTableView];
  80. [self refreshHeaderView];
  81. if ([self shouldLazyLoadListView]) {
  82. self.mainTableView.horizontalScrollViewList = @[self.listContainerView.collectionView];
  83. }
  84. }
  85. - (void)setHorizontalScrollViewList:(NSArray *)horizontalScrollViewList {
  86. _horizontalScrollViewList = horizontalScrollViewList;
  87. NSMutableArray *list = [NSMutableArray arrayWithArray:horizontalScrollViewList];
  88. if ([self shouldLazyLoadListView]) {
  89. [list addObject:self.listContainerView.collectionView];
  90. }
  91. self.mainTableView.horizontalScrollViewList = list;
  92. }
  93. - (void)setLazyLoadList:(BOOL)lazyLoadList {
  94. _lazyLoadList = lazyLoadList;
  95. if ([self shouldLazyLoadListView]) {
  96. self.mainTableView.horizontalScrollViewList = @[self.listContainerView.collectionView];
  97. }else {
  98. // listScrollView滑动处理
  99. [self configListViewScroll];
  100. }
  101. }
  102. - (void)setMainScrollDisabled:(BOOL)mainScrollDisabled {
  103. _mainScrollDisabled = mainScrollDisabled;
  104. self.mainTableView.scrollEnabled = !self.mainScrollDisabled;
  105. if (self.mainScrollDisabled) {
  106. self.mainTableView.scrollsToTop = NO;
  107. }
  108. }
  109. #pragma mark - Public Methods
  110. - (void)refreshHeaderView {
  111. UIView *headerView = [self.delegate headerViewInPageScrollView:self];
  112. self.mainTableView.tableHeaderView = headerView;
  113. self.headerHeight = headerView.frame.size.height;
  114. self.criticalPoint = fabs([self.mainTableView rectForSection:0].origin.y - self.ceilPointHeight);
  115. self.criticalOffset = CGPointMake(0, self.criticalPoint);
  116. }
  117. - (void)refreshSegmentedView {
  118. if ([self shouldLazyLoadListView]) {
  119. UIView *segmentedView = [self.delegate segmentedViewInPageScrollView:self];
  120. CGRect frame = self.listContainerView.frame;
  121. frame.origin.y = segmentedView.frame.size.height;
  122. self.listContainerView.frame = frame;
  123. }
  124. }
  125. - (void)reloadData {
  126. self.isLoaded = YES;
  127. for (id<GKPageListViewDelegate> list in self.validListDict.allValues) {
  128. [list.listView removeFromSuperview];
  129. }
  130. [_validListDict removeAllObjects];
  131. // 判断加载方式
  132. if ([self shouldLazyLoadListView]) {
  133. [self.listContainerView reloadData];
  134. }else {
  135. [self configListViewScroll];
  136. }
  137. if (self.isShowInFooter) {
  138. self.mainTableView.tableFooterView = [self getPageView];
  139. }else {
  140. [self.mainTableView reloadData];
  141. }
  142. self.criticalPoint = fabs([self.mainTableView rectForSection:0].origin.y - self.ceilPointHeight);
  143. self.criticalOffset = CGPointMake(0, self.criticalPoint);
  144. }
  145. - (void)horizonScrollViewWillBeginScroll {
  146. self.mainTableView.scrollEnabled = NO;
  147. }
  148. - (void)horizonScrollViewDidEndedScroll {
  149. self.mainTableView.scrollEnabled = YES;
  150. }
  151. - (void)scrollToOriginalPoint {
  152. // 这里做了0.01秒的延时,是为了解决一个坑:当通过手势滑动结束调用此方法时,会有可能出现动画结束后UITableView没有回到原点的bug
  153. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  154. if (self.isScrollToOriginal) return;
  155. self.isScrollToOriginal = YES;
  156. self.isCeilPoint = NO;
  157. self.isMainCanScroll = YES;
  158. self.isListCanScroll = NO;
  159. [self.mainTableView setContentOffset:CGPointZero animated:YES];
  160. });
  161. }
  162. - (void)scrollToCriticalPoint {
  163. if (self.isScrollToCritical) return;
  164. self.isScrollToCritical = YES;
  165. [self.mainTableView setContentOffset:self.criticalOffset animated:YES];
  166. self.isMainCanScroll = NO;
  167. self.isListCanScroll = YES;
  168. [self mainTableViewCanScrollUpdate];
  169. }
  170. #pragma mark - Private Methods
  171. - (void)configListViewScroll {
  172. [[self.delegate listViewsInPageScrollView:self] enumerateObjectsUsingBlock:^(id<GKPageListViewDelegate> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  173. __weak typeof(self) weakSelf = self;
  174. [obj listViewDidScrollCallback:^(UIScrollView * _Nonnull scrollView) {
  175. [weakSelf listScrollViewDidScroll:scrollView];
  176. }];
  177. }];
  178. }
  179. - (void)listScrollViewDidScroll:(UIScrollView *)scrollView {
  180. self.currentListScrollView = scrollView;
  181. if (self.isMainScrollDisabled) return;
  182. if (self.isScrollToOriginal || self.isScrollToCritical) return;
  183. // 获取listScrollview偏移量
  184. CGFloat offsetY = scrollView.contentOffset.y;
  185. // listScrollView下滑至offsetY小于0,禁止其滑动,让mainTableView可下滑
  186. if (offsetY <= 0) {
  187. if (self.isDisableMainScrollInCeil) {
  188. if (self.isAllowListRefresh && offsetY < 0 && self.isCeilPoint) {
  189. self.isMainCanScroll = NO;
  190. self.isListCanScroll = YES;
  191. }else {
  192. self.isMainCanScroll = YES;
  193. self.isListCanScroll = NO;
  194. [self setScrollView:scrollView offset:CGPointZero];
  195. if (self.isControlVerticalIndicator) {
  196. scrollView.showsVerticalScrollIndicator = NO;
  197. }
  198. }
  199. }else {
  200. if (self.isAllowListRefresh && offsetY < 0 && self.mainTableView.contentOffset.y == 0) {
  201. self.isMainCanScroll = NO;
  202. self.isListCanScroll = YES;
  203. }else {
  204. self.isMainCanScroll = YES;
  205. self.isListCanScroll = NO;
  206. [self setScrollView:scrollView offset:CGPointZero];
  207. if (self.isControlVerticalIndicator) {
  208. scrollView.showsVerticalScrollIndicator = NO;
  209. }
  210. }
  211. }
  212. }else {
  213. if (self.isListCanScroll) {
  214. if (self.isControlVerticalIndicator) {
  215. scrollView.showsVerticalScrollIndicator = YES;
  216. }
  217. CGFloat headerHeight = self.headerHeight;
  218. if (floor(headerHeight) == 0) {
  219. [self setScrollView:self.mainTableView offset:self.criticalOffset];
  220. }else {
  221. // 如果此时mianTableView并没有滑动,则禁止listView滑动
  222. if (self.mainTableView.contentOffset.y == 0 && floor(headerHeight) != 0) {
  223. self.isMainCanScroll = YES;
  224. self.isListCanScroll = NO;
  225. [self setScrollView:scrollView offset:CGPointZero];
  226. if (self.isControlVerticalIndicator) {
  227. scrollView.showsVerticalScrollIndicator = NO;
  228. }
  229. }else { // 矫正mainTableView的位置
  230. [self setScrollView:self.mainTableView offset:self.criticalOffset];
  231. }
  232. }
  233. }else {
  234. [self setScrollView:scrollView offset:CGPointZero];
  235. }
  236. }
  237. }
  238. - (void)mainScrollViewDidScroll:(UIScrollView *)scrollView {
  239. if (!self.isBeginDragging) {
  240. // 点击状态栏滑动
  241. [self listScrollViewOffsetFixed];
  242. [self mainTableViewCanScrollUpdate];
  243. return;
  244. }
  245. // 获取mainScrollview偏移量
  246. CGFloat offsetY = scrollView.contentOffset.y;
  247. if (self.isScrollToOriginal || self.isScrollToCritical) return;
  248. // 根据偏移量判断是否上滑到临界点
  249. if (offsetY >= self.criticalPoint) {
  250. self.isCriticalPoint = YES;
  251. }else {
  252. self.isCriticalPoint = NO;
  253. }
  254. // 无偏差临界点,对float值取整判断
  255. if (!self.isCeilPoint ) {
  256. if (floor(offsetY) == floor(self.criticalPoint)) {
  257. self.isCeilPoint = YES;
  258. }
  259. }
  260. if (self.isCriticalPoint) {
  261. // 上滑到临界点后,固定其位置
  262. [self setScrollView:scrollView offset:self.criticalOffset];
  263. self.isMainCanScroll = NO;
  264. self.isListCanScroll = YES;
  265. }else {
  266. // 当滑动到无偏差临界点且不允许mainScrollView滑动时做处理
  267. if (self.isCeilPoint && self.isDisableMainScrollInCeil) {
  268. self.isMainCanScroll = NO;
  269. self.isListCanScroll = YES;
  270. [self setScrollView:scrollView offset:self.criticalOffset];
  271. }else {
  272. if (self.isDisableMainScrollInCeil) {
  273. if (self.isMainCanScroll) {
  274. // 未达到临界点,mainScrollview可滑动,需要重置所有listScrollView的位置
  275. [self listScrollViewOffsetFixed];
  276. }else {
  277. // 未到达临界点,mainScrollView不可滑动,固定mainScrollView的位置
  278. [self mainScrollViewOffsetFixed];
  279. }
  280. }else {
  281. // 如果允许列表刷新,并且mainTableView的offsetY小于0 或者 当前列表的offsetY小于0,mainScrollView不可滑动
  282. if (self.isAllowListRefresh && ((offsetY <= 0 && self.isMainCanScroll) || (self.currentListScrollView.contentOffset.y < 0 && self.isListCanScroll))) {
  283. [self setScrollView:scrollView offset:CGPointZero];
  284. }else {
  285. if (self.isMainCanScroll) {
  286. // 未达到临界点,mainScrollview可滑动,需要重置所有listScrollView的位置
  287. [self listScrollViewOffsetFixed];
  288. }else {
  289. // 未到达临界点,mainScrollView不可滑动,固定mainScrollView的位置
  290. [self mainScrollViewOffsetFixed];
  291. }
  292. }
  293. }
  294. }
  295. }
  296. [self mainTableViewCanScrollUpdate];
  297. }
  298. // 修正mainTableView的位置
  299. - (void)mainScrollViewOffsetFixed {
  300. if ([self shouldLazyLoadListView]) {
  301. for (id<GKPageListViewDelegate> listItem in self.validListDict.allValues) {
  302. UIScrollView *listScrollView = [listItem listScrollView];
  303. if (listScrollView.contentOffset.y != 0) {
  304. [self setScrollView:self.mainTableView offset:self.criticalOffset];
  305. }
  306. }
  307. }else {
  308. [[self.delegate listViewsInPageScrollView:self] enumerateObjectsUsingBlock:^(id<GKPageListViewDelegate> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  309. UIScrollView *listScrollView = [obj listScrollView];
  310. if (listScrollView.contentOffset.y != 0) {
  311. [self setScrollView:self.mainTableView offset:self.criticalOffset];
  312. }
  313. }];
  314. }
  315. }
  316. // 修正listScrollView的位置
  317. - (void)listScrollViewOffsetFixed {
  318. if ([self shouldLazyLoadListView]) {
  319. for (id<GKPageListViewDelegate> listItem in self.validListDict.allValues) {
  320. UIScrollView *listScrollView = [listItem listScrollView];
  321. [self setScrollView:listScrollView offset:CGPointZero];
  322. if (self.isControlVerticalIndicator) {
  323. listScrollView.showsVerticalScrollIndicator = NO;
  324. }
  325. }
  326. }else {
  327. [[self.delegate listViewsInPageScrollView:self] enumerateObjectsUsingBlock:^(id<GKPageListViewDelegate> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  328. UIScrollView *listScrollView = [obj listScrollView];
  329. [self setScrollView:listScrollView offset:CGPointZero];
  330. if (self.isControlVerticalIndicator) {
  331. listScrollView.showsVerticalScrollIndicator = NO;
  332. }
  333. }];
  334. }
  335. }
  336. - (void)mainTableViewCanScrollUpdate {
  337. if ([self.delegate respondsToSelector:@selector(mainTableViewDidScroll:isMainCanScroll:)]) {
  338. [self.delegate mainTableViewDidScroll:self.mainTableView isMainCanScroll:self.isMainCanScroll];
  339. }
  340. }
  341. - (BOOL)shouldLazyLoadListView {
  342. if ([self.delegate respondsToSelector:@selector(shouldLazyLoadListInPageScrollView:)]) {
  343. return [self.delegate shouldLazyLoadListInPageScrollView:self];
  344. }else {
  345. return _lazyLoadList;
  346. }
  347. }
  348. - (void)setScrollView:(UIScrollView *)scrollView offset:(CGPoint)offset {
  349. if (!CGPointEqualToPoint(scrollView.contentOffset, offset)) {
  350. scrollView.contentOffset = offset;
  351. }
  352. }
  353. - (UIView *)getPageView {
  354. CGFloat width = self.frame.size.width == 0 ? GKPAGE_SCREEN_WIDTH : self.frame.size.width;
  355. CGFloat height = self.frame.size.height == 0 ? GKPAGE_SCREEN_HEIGHT : self.frame.size.height;
  356. UIView *pageView = self.pageView ? self.pageView : nil;
  357. if ([self shouldLazyLoadListView]) {
  358. if (!pageView) pageView = [UIView new];
  359. UIView *segmentedView = [self.delegate segmentedViewInPageScrollView:self];
  360. CGFloat x = 0;
  361. CGFloat y = segmentedView.frame.size.height;
  362. CGFloat w = width;
  363. CGFloat h = height - y;
  364. h -= (self.isMainScrollDisabled ? self.headerHeight : self.ceilPointHeight);
  365. self.listContainerView.frame = CGRectMake(x, y, w, h);
  366. [pageView addSubview:segmentedView];
  367. [pageView addSubview:self.listContainerView];
  368. }else {
  369. pageView = [self.delegate pageViewInPageScrollView:self];
  370. }
  371. height -= (self.isMainScrollDisabled ? self.headerHeight : self.ceilPointHeight);
  372. pageView.frame = CGRectMake(0, 0, width, height);
  373. self.pageView = pageView;
  374. return pageView;
  375. }
  376. #pragma mark - UITableViewDataSource & UITableViewDelegate
  377. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  378. if (self.isShowInFooter) return 0;
  379. return self.isLoaded ? 1 : 0;
  380. }
  381. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  382. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
  383. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  384. if ([self.delegate respondsToSelector:@selector(pageScrollView:updateCell:)]) {
  385. [self.delegate pageScrollView:self updateCell:cell];
  386. }
  387. [cell.contentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
  388. [cell.contentView addSubview:[self getPageView]];
  389. if ([self.delegate respondsToSelector:@selector(pageScrollViewReloadCell:)]) {
  390. [self.delegate pageScrollViewReloadCell:self];
  391. }
  392. return cell;
  393. }
  394. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  395. if (self.showInFooter) return 0;
  396. CGFloat height = self.frame.size.height == 0 ? GKPAGE_SCREEN_HEIGHT : self.frame.size.height;
  397. height -= (self.isMainScrollDisabled ? self.headerHeight : self.ceilPointHeight);
  398. return height;
  399. }
  400. - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {
  401. return NO;
  402. }
  403. #pragma mark - GKPageListContainerViewDelegate
  404. - (NSInteger)numberOfRowsInListContainerView:(GKPageListContainerView *)listContainerView {
  405. return [self.delegate numberOfListsInPageScrollView:self];
  406. }
  407. - (UIView *)listContainerView:(GKPageListContainerView *)listContainerView listViewInRow:(NSInteger)row {
  408. id<GKPageListViewDelegate> list = self.validListDict[@(row)];
  409. if (list == nil) {
  410. list = [self.delegate pageScrollView:self initListAtIndex:row];
  411. __weak typeof(self) weakSelf = self;
  412. [list listViewDidScrollCallback:^(UIScrollView *scrollView) {
  413. [weakSelf listScrollViewDidScroll:scrollView];
  414. }];
  415. _validListDict[@(row)] = list;
  416. }
  417. return [list listView];
  418. }
  419. #pragma mark - UIScrollViewDelegate
  420. - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
  421. self.isBeginDragging = YES;
  422. if (self.isScrollToOriginal) {
  423. self.isScrollToOriginal = NO;
  424. self.isCeilPoint = NO;
  425. }
  426. if (self.isScrollToCritical) {
  427. self.isScrollToCritical = NO;
  428. self.isCeilPoint = YES;
  429. }
  430. if ([self.delegate respondsToSelector:@selector(mainTableViewWillBeginDragging:)]) {
  431. [self.delegate mainTableViewWillBeginDragging:scrollView];
  432. }
  433. }
  434. - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
  435. [self mainScrollViewDidScroll:scrollView];
  436. }
  437. - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
  438. if (!decelerate) {
  439. self.isBeginDragging = NO;
  440. }
  441. if ([self.delegate respondsToSelector:@selector(mainTableViewDidEndDragging:willDecelerate:)]) {
  442. [self.delegate mainTableViewDidEndDragging:scrollView willDecelerate:decelerate];
  443. }
  444. }
  445. - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
  446. self.isBeginDragging = NO;
  447. if ([self.delegate respondsToSelector:@selector(mainTableViewDidEndDecelerating:)]) {
  448. [self.delegate mainTableViewDidEndDecelerating:scrollView];
  449. }
  450. }
  451. - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
  452. if ([self.delegate respondsToSelector:@selector(mainTableViewDidEndScrollingAnimation:)]) {
  453. [self.delegate mainTableViewDidEndScrollingAnimation:scrollView];
  454. }
  455. if (self.isScrollToOriginal) {
  456. self.isScrollToOriginal = NO;
  457. self.isCeilPoint = NO;
  458. // 修正listView偏移
  459. [self listScrollViewOffsetFixed];
  460. }
  461. if (self.isScrollToCritical) {
  462. self.isScrollToCritical = NO;
  463. self.isCeilPoint = YES;
  464. }
  465. [self mainTableViewCanScrollUpdate];
  466. }
  467. #pragma mark - 懒加载
  468. - (GKPageListContainerView *)listContainerView {
  469. if (!_listContainerView) {
  470. _listContainerView = [[GKPageListContainerView alloc] initWithDelegate:self];
  471. }
  472. return _listContainerView;
  473. }
  474. @end