File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -363,14 +363,6 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
363
363
364
364
float offset = 0 ;
365
365
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
-
374
366
if (self.isHorizontal ) {
375
367
if (self.frame .size .width != 0 ) {
376
368
offset = (point.x - self.frame .size .width )/self.frame .size .width ;
@@ -390,6 +382,16 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
390
382
absoluteOffset = 1 - absoluteOffset;
391
383
}
392
384
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
+
393
395
self.lastContentOffset = scrollView.contentOffset ;
394
396
[self .eventDispatcher sendEvent: [[RCTOnPageScrollEvent alloc ] initWithReactTag: self .reactTag position: @(position) offset: @(absoluteOffset)]];
395
397
}
You can’t perform that action at this time.
0 commit comments