我们使用React Native Router来管理导航。我们路由器的渲染函数如下所示:
<Scene key="tabbar" tabs={true} hideNavBar={true} tabBarStyle={{position: 'absolute', top: 0, left: 0}}>
<Scene key={TAB_1} component={Tab1Container} icon={TabIcon} title={TAB_1_TITLE} hideNavBar={true} />
<Scene key={TAB_2} component={Tab2Container} icon={TabIcon} title={TAB_2_TITLE} hideNavBar={true} />
<Scene key={TAB_3} component={Tab3Container} icon={TabIcon} title={TAB_3_TITLE} hideNavBar={true} />
<Scene key={TAB_4} component={Tab4Container} icon={TabIcon} title={TAB_4_TITLE} hideNavBar={true} />
<Scene key={TAB_5} component={Tab5Container} icon={TabIcon} title={TAB_5_TITLE} hideNavBar={true} />
</Scene>
在我们的应用程序中,不允许立即从 TAB_1 跳转到 TAB_5。您必须通过 TAB_2 到 TAB_5。目前我可以从头跳到尾
现在我找不到任何可能在触发 Action 之前触发类似函数的功能。
伪代码:
if(current_pressed_tab <= progress_tab){
//head on to next tab
}
else{
//make nothing
}
我可以使用任何功能或回调道具吗?