我已经使用react-navigation
创建了一个底部导航器。如何将其用于底部导航器中未包含的其他屏幕?
const Stack = createStackNavigator({
intro: {
screen: IntroSlides
},
dashboard: {
screen: createBottomTabNavigator({
inbox: {
screen: Inbox,
navigationOptions: ({ navigation }) => ({
tabBarIcon: () => (
<Image resizeMode={'contain'} style={styles.icon} source={require('./src/assets/MyProfileIcon.png')} />
),
title: 'Profile',
}),
},
favourite: {
screen: Favourite,
navigationOptions: ({ navigation }) => ({
tabBarIcon: () => (
<Image resizeMode={'contain'} style={styles.icon} source={require('./src/assets/FavouriteIcon.png')} />
),
title: 'Favourite',
}),
答案 0 :(得分:0)
将其他项目/屏幕放置在堆栈导航器中:
const Bottom = createBottomTabNavigator({
item1: {screen: Screen1},
item2: {screen: Screen2},
},{
initialRouteName: "item1",
}
)
export default createStackNavigator({
tabs: Bottom,
item3: Screen3, // your other screen
})
,如果要从item3屏幕隐藏stacknavigator,可以在组件中使用它:
static navigationOptions = ({ navigation, screenProps }) => ({
header: null
});