File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -363,14 +363,6 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
363363
364364 float offset = 0 ;
365365
366- if (!_overdrag) {
367- if (_currentIndex == 0 && scrollView.contentOffset .x < scrollView.bounds .size .width ) {
368- scrollView.contentOffset = CGPointMake (scrollView.bounds .size .width , 0 );
369- } else if (_currentIndex == _reactPageIndicatorView.numberOfPages - 1 && scrollView.contentOffset .x > scrollView.bounds .size .width ) {
370- scrollView.contentOffset = CGPointMake (scrollView.bounds .size .width , 0 );
371- }
372- }
373-
374366 if (self.isHorizontal ) {
375367 if (self.frame .size .width != 0 ) {
376368 offset = (point.x - self.frame .size .width )/self.frame .size .width ;
@@ -390,6 +382,16 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
390382 absoluteOffset = 1 - absoluteOffset;
391383 }
392384
385+ if (!_overdrag) {
386+ if (_currentIndex == 0 && scrollView.contentOffset .x < scrollView.bounds .size .width ) {
387+ scrollView.contentOffset = CGPointMake (scrollView.bounds .size .width , 0 );
388+ absoluteOffset=0 ;
389+ } else if (_currentIndex == _reactPageIndicatorView.numberOfPages - 1 && scrollView.contentOffset .x > scrollView.bounds .size .width ) {
390+ scrollView.contentOffset = CGPointMake (scrollView.bounds .size .width , 0 );
391+ absoluteOffset=0 ;
392+ }
393+ }
394+
393395 self.lastContentOffset = scrollView.contentOffset ;
394396 [self .eventDispatcher sendEvent: [[RCTOnPageScrollEvent alloc ] initWithReactTag: self .reactTag position: @(position) offset: @(absoluteOffset)]];
395397}
You can’t perform that action at this time.
0 commit comments