Android上的React导航: 在堆栈导航器中,如何禁用滑动选项卡导航器。 THX
答案 0 :(得分:1)
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
};
};
答案 1 :(得分:0)
将此添加到StackNavigator中的每个屏幕:
static navigationOptions = {
swipeEnabled: false,
}