本文介绍了react-native-navigation |设置初始屏幕而不将其作为选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的 React Native 应用程序上设置初始屏幕,但不将其作为选项卡.
I want to set initial screen on my react native app, but without putting it as a tab.
我的意思是我希望能够在屏幕外访问 navigator.push
,就像这样.
I mean I want to be able to reach the navigator.push
outside a screen, something like this.
Navigation.startTabBasedApp({
tabs: [
screen: 'Signup'
]
})
Navigator.push({
screen: 'Landing',
})
推荐答案
查看此文档 https://wix.github.io/react-native-navigation/#/top-level-api
您需要使用Navigation.startSingleScreenApp
.接下来,如果您需要打开标签栏,只需调用 Navigation.startTabBasedApp
从您的应用程序的任何位置.
You need to use Navigation.startSingleScreenApp
. Next, if u need open tab bar, just call Navigation. startTabBasedApp
from anywhere in your application.
https://wix.github.io/react-native-navigation/#/screen-api
另外,你可以试试resetTo(params)
这篇关于react-native-navigation |设置初始屏幕而不将其作为选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!