We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5e04e1 commit 87a09ddCopy full SHA for 87a09dd
ios/ReactNativePageView.m
@@ -325,9 +325,13 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
325
CGPoint point = scrollView.contentOffset;
326
float offset = 0;
327
if (self.orientation == UIPageViewControllerNavigationOrientationHorizontal) {
328
- offset = (point.x - self.frame.size.width)/self.frame.size.width;
+ if (self.frame.size.width != 0) {
329
+ offset = (point.x - self.frame.size.width)/self.frame.size.width;
330
+ }
331
} else {
- offset = (point.y - self.frame.size.height)/self.frame.size.height;
332
+ if (self.frame.size.height != 0) {
333
+ offset = (point.y - self.frame.size.height)/self.frame.size.height;
334
335
}
336
if(fabs(offset) > 1) {
337
offset = offset > 0 ? 1.0 : -1.0;
0 commit comments