【发布时间】:2020-05-11 09:21:43
【问题描述】:
我正在使用 Expo 构建一个 React-Native 应用程序。我尝试实现BottomTabNavigator,但由于某种原因,内容(TripsPage)出现了两次。
这是我的导航实现:
<NavigationContainer>
<Stack.Navigator
initialRouteName="TripsPage"
screenOptions={{
headerStyle: {
backgroundColor: Colors.primary,
},
headerTintColor: 'black',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
fontSize: 18,
},
}}
>
<Stack.Screen
name="TripDetails"
component={TripDetails}
options={{ title: 'Trip Details' }}
/>
<Stack.Screen
name="TripsPage"
component={TripsPage}
options={{ title: 'Home' }}
/>
<Stack.Screen
name="MVPForm"
component={Form}
options={{ title: 'Trippy' }}
/>
<Stack.Screen
name="Result"
component={Result}
options={{ title: 'Car Allocation' }}
/>
</Stack.Navigator>
</NavigationContainer>
<NavigationContainer>
<Tab.Navigator>
<Tab.Screen name="Home" component={TripsPage} />
</Tab.Navigator>
</NavigationContainer>
有人熟悉这个问题吗?
【问题讨论】:
标签: react-native react-navigation-bottom-tab