问题描述
我正在尝试使用React Native Navigation来实现上述导航模式,并且使它正常工作,但是当尝试从状态C返回到状态B时,后退按钮似乎无法正常工作。
状态A是应用程序根目录,然后当用户要从状态A导航到状态B时,我将推送底部的选项卡布局。每个选项卡项均包含其自己的堆栈,并且当用户希望导航至状态CI时,我推送状态C屏幕。到目前为止,它工作正常,但是现在按下后退按钮(iOS和Android中都为Android硬件后退或顶部栏后退按钮)时,React Native Navigation显示状态A而不是状态B。
Navigation.events().registerappLaunchedListener(async () => {
Navigation.setRoot({
root: {
stack: {
children: [
{
component: {
name: 'app.home' // State A
}
}
]
}
}
});
});
//when user want to navigate from State A to State B
Navigation.push(componentId,{
bottomTabs: {
children: [
{
stack: {
children: [
{
component: {
name: 'app.overview'
}
}
]
}
},{
stack: {
children: [
{
component: {
name: 'secure.profile'
}
}
]
}
}
]
}
});
// when user want to navigate from State B to State C
Navigation.push(componentId,{
component: {
name: 'app.overview.details',passprops: {
data: {
...props
}
}
}
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)