-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to control swipe and return to the specified page instead of the previous page(ios) #3187
Comments
call
if you want to navigate to a specific page. Or,
If you want to return to a specific page. take at look at here I never tried to use swipe gesture to navigate between pages, but you may also tried to implement the e.g.
|
I know this, I often use these methods。But I mean when I slide back right, not when I click back。For example, A->B->C, in the C page, I hope that when I can slide right, I will return the A page instead of the B page. The reason why I have this requirement is because I don't want users to ban right slides on C pages (I don't want to use panHandlers={null}). I personally think that prohibiting right slip is not very friendly. Is there a way to solve this problem? If there is no better way, I will use panHandlers={null}. Thanks. |
How about |
How to use onBack in the right swipe gesture, I found a lot of information not found, I hope to provide reference code, thank you. |
That's the point, I'm not sure whether onBack handles the swipe gesture in iOS, but it DOES handle the back button in the nav bar AND the hardware back button in Android devices. You may try
|
I found that ios's right-sliding back and Android's hardware back button won't trigger the onBack method. |
Too bad. For android, you can implement the backhandler For ios though, still searching |
Yes, but thank you for answering me. |
Hey guys, looking into the issue history I found out that |
Not a problem with BackHandler. I mean when I slide back right, not when I click back。For example, A->B->C, in the C page, I hope that when I can slide right, I will return the A page instead of the B page. The reason why I have this requirement is because I don't want users to ban right slides on C pages (I don't want to use panHandlers={null}). I personally think that prohibiting right slip is not very friendly. Is there a way to solve this problem? If there is no better way, I will use panHandlers={null}. Thanks. |
Sorry - I misread the issue. Maybe we could work in a new event here? Not sure yet how to fix it - I am checking other issues with the |
Is there a way to solve this problem? thanks |
OK, I think none of the libraries will be able to provide an elegant solution, since even iOS native doesn't provide a high level api for that. You may try to take reference from that, override the pan gesture and call |
thanks,I'll look at the use of React Native Gesture Handler, but I have an idea of directly manipulating Actions.state to see if I can delete a page in state, so I don't have to modify the swipe gesture, but it feels so dangerous. |
Version
Tell us which versions you are using:
Expected behaviour
How to control swipe and return to the specified page instead of the previous page(ios)
The text was updated successfully, but these errors were encountered: