[英]React Navigation Bottom Tab Bar backPress handling
I am going to make the current route back to the previous route after pressing the back button. 按下返回按钮后,我将使当前路线回到上一条路线。
For example: there are 5 bottom tabs which are call Page1,Page2,Page3,Page4,Page5, and the initialRouteName is Page1 例如:有5个底部选项卡,分别称为Page1,Page2,Page3,Page4,Page5,而initialRouteName为Page1。
Assume i browse Page1->Page2->Page3->Page4 , i expect the result is Page4->Page3->Page2->Page1 when i keep pressing the back button. 假设我浏览Page1-> Page2-> Page3-> Page4,当我按住后退按钮时,我期望结果是Page4-> Page3-> Page2-> Page1。 But the final result is Page4 -> Page1.
但是最终结果是Page4-> Page1。
How can i achieve this? 我怎样才能实现这一目标? Is is using redux to store the browse recording and set the BackHandler for Android or do some logic for IOS to achieve this?
是使用redux来存储浏览记录并为Android设置BackHandler,还是为IOS做一些逻辑来做到这一点?
You could use React Native Router Flux. 您可以使用React Native Router Flux。 In this link you have all steps to install it and use it.
在此链接中,您具有安装和使用它的所有步骤。 https://www.npmjs.com/package/react-native-router-flux I hope it works you!
https://www.npmjs.com/package/react-native-router-flux我希望它对您有用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.