initialParams = {}
localinitialRouteName = 'Root'
localInitialParams = { screen: 'TabList', params: { screen: 'TabListScreen', params: { ...initialParams } } }
return (
<Stack.Navigator initialRouteName={localinitialRouteName || 'Root'}>
<Stack.Screen
name="Root"
component={BottomTabNavigator}
initialParams={localInitialParams}
options={{
headerShown: false,
cardStyleInterpolator: () => ({
cardStyle: {
opacity: 1
}
})
}}
/>
</Stack.Navigator
)
隐藏底部tab栏
<BottomTab.Navigator
screenOptions={{
tabBarStyle: {
display: tabBarVisible === false ? 'none' : 'flex' // 是否隐藏底部tabbar
},
}}
隐藏头部
<BottomTab.Navigator
headerShown: false,
}}