小编Dyo*_*obi的帖子

反应本机材料顶部选项卡导航器滑动禁用取决于屏幕

只想使地图组件滑动禁用,但在使用“swipeEnabled”时应用了整个屏幕。

我能怎么做?

const Tab = createMaterialTopTabNavigator();

const Tabs = () => {

  return (
    <Tab.Navigator
      swipeEnabled={false}  // <- Screens can be swiped but it is applied to every screen.
      {...}
    >
      <Tab.Screen
        name="Home"
        component={Home}
      />
      <Tab.Screen
        name="Map"
        component={Map}
      /> 
    </Tab.Navigator>
  );
}

const App = () => {
  return (
    <NavigationContainer>
      <SafeAreaView style={styles.safeAreaView} />
      <Tabs />
    </NavigationContainer>
  );
}
Run Code Online (Sandbox Code Playgroud)

react-native react-navigation

4
推荐指数
1
解决办法
7644
查看次数

标签 统计

react-native ×1

react-navigation ×1