反应本机导航 |设置初始屏幕而不将其作为选项卡?
react-native-navigation | Setting initial screen without putting it as tab?
我想在我的 React Native 应用程序上设置初始屏幕,但不想将其作为选项卡。
我的意思是我希望能够到达屏幕外的 navigator.push
,类似这样。
Navigation.startTabBasedApp({
tabs: [
screen: 'Signup'
]
})
Navigator.push({
screen: 'Landing',
})
查看此文档https://wix.github.io/react-native-navigation/#/top-level-api
您需要使用 Navigation.startSingleScreenApp
。接下来,如果您需要打开标签栏,只需在应用程序的任何位置调用 Navigation. startTabBasedApp
。
https://wix.github.io/react-native-navigation/#/screen-api
另外,你可以试试resetTo(params)
我想在我的 React Native 应用程序上设置初始屏幕,但不想将其作为选项卡。
我的意思是我希望能够到达屏幕外的 navigator.push
,类似这样。
Navigation.startTabBasedApp({
tabs: [
screen: 'Signup'
]
})
Navigator.push({
screen: 'Landing',
})
查看此文档https://wix.github.io/react-native-navigation/#/top-level-api
您需要使用 Navigation.startSingleScreenApp
。接下来,如果您需要打开标签栏,只需在应用程序的任何位置调用 Navigation. startTabBasedApp
。
https://wix.github.io/react-native-navigation/#/screen-api
另外,你可以试试resetTo(params)