android上的反应导航:在堆栈导航器中,如何禁用Tab Navigator的滑动。thx
ABCNav.navigationOptions = ({ navigation, screenProps }) => {
if (navigation.state.index != 0) {
return {
tabBarVisible: false,
swipeEnabled: false, //disable swipe inside StackNavigator
};
}
return {
tabBarVisible: true,
//enable swipe function for first screen
};
};
将其添加到stacknavigator中的每个屏幕:
static navigationOptions = {
swipeEnabled: false,
}