我将使用StackNavigation获取Push和Pop的参数。它的工作正常。但是现在我想在StackNavigation之后的一些屏幕TabBar之后实现,有任何想法如何在StackNavigation之后使用TabBar。
注意:我想实现Custom TabBar。
请帮帮我。
答案 0 :(得分:2)
您可以执行类似
的操作let StackWithTabs1 = StackNavigator({ // stackNavigator inside the tabNavigator
Screen3:{
screen: Screen3
}
,Screen4:{
screen: Screen4
}
});
let StackWithTabs2 = StackNavigator({ // stackNavigator inside the tabNavigator
Screen5:{
screen: Screen5
}
,Screen6:{
screen: Screen6
}
});
let tab_bar = TabNavigator({
StackWithTabs1 : {
screen: StackWithTabs1 // Calling the stackNavigators that going to go inside the tabNavigator
},
StackWithTabs2 : {
screen: StackWithTabs2
}
});
let InitialStackNavigator = StackNavigator({
Screen1: {
screen: Screen1
},
Screen2: {
screen: Screen2
},
tabBar: {
screen: tab_bar // Calling the tabNavigator, wich contains the other stackNavigators
}
});
只需声明您的tabNavigator
及其stackNavigators
,然后在主stackNavigator
上调用它们。