简体   繁体   English

反应导航底部选项卡栏返回按处理

[英]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.

相关问题 使用反应导航中的底部标签栏并将其移动到侧面 - using a bottom tab bar from react navigation and move it to the side 如何在反应导航 v5 中处理底部标签栏的可见性? - How to handle bottom tab bar visibility in react navigation v5? React Navigation V5 在 Stack Navigator 中隐藏底部标签栏 - React Navigation V5 hide Bottom tab bar in Stack Navigator v3中未显示React导航底部标签栏的图标 - Icons not displaying for React Navigation Bottom Tab Bar in v3 使用 navigationOptions 在 React Navigation 中基于 state 更改底部标签栏 - Change Bottom Tab Bar based on state in React Navigation with navigationOptions 反应导航 5,在第二个堆栈屏幕上隐藏底部标签栏? - React navigation 5, hide bottom tab bar on second stack screen? 如何在 React-Navigation 底部标签栏下方显示内容? - How to show content below bottom tab bar in React-Navigation? 如何更改反应导航底部标签栏中的高度? - How do I change the elevation in react navigation bottom tab bar? React Native 底部标签导航 - React Native Bottom Tab Navigation 使用时如何从底部标签栏隐藏“SPECIFIC TAB BAR ITEM”:@react-navigation/bottom-tabs - How to hide a "SPECIFIC TAB BAR ITEM" from a bottom tab bar when using: @react-navigation/bottom-tabs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM