Infinite swiping between tabs with createMaterialTopTabNavigator #9515
Unanswered
Estebank94
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to create an infinite swiping effect between tabs using MaterialTopTabNavigator.
If we have 3 Screens the user could go from screen 1 to screen 2 by swiping to the left or screen 3 by swiping to the right. If the user is in screen 3, he could go from screen 3 to screen 2 by swiping to the right and to screen 0 by swiping to the left.
It would look something like this: ...[3] <- [0]->[1]->[2]->[3]->[0]...
I have managed to achieve this by rotating the array of screens so I always have a screen before and a screen after my current screen but this is inefficient as I am always creating a new array when I change between tabs.
I was wondering if someone has stumbled with the same problem and if there is a better way of solving this.
Beta Was this translation helpful? Give feedback.
All reactions