【问题标题】:swipeEnabled is not working in TabNavigator for swipe disableswipeEnabled 在 TabNavigator 中无法用于滑动禁用
【发布时间】:2018-12-28 10:19:03
【问题描述】:

我想在 TabNavigator 中禁用滑动以更改选项卡。 我找到了两种解决方案

1) swipeEnabled: false,

2) navigationOptions: { gesturesEnabled: false }

两者都不适用于 iOS 的 react-native。 任何解决方案都会有所帮助。

【问题讨论】:

  • 什么反应导航版本?
  • @Li357 已使用 ^2.8.0

标签: ios react-native tabnavigator react-native-tabnavigator


【解决方案1】:

这适用于“react-native”:“^0.55.4”并且已经工作了很长时间

import { createBottomTabNavigator, createStackNavigator } from "react-navigation";

const MyTabView = createBottomTabNavigator(
      {
        screen1: { screen: screen1 },
        screen2: { screen: screen2 },

      },
      {
        swipeEnabled: false,
    }
}

【讨论】:

  • @Alainlb 我想使用顶部标签栏所以不能使用底部TabNavigator
猜你喜欢
  • 2018-06-15
  • 1970-01-01
  • 1970-01-01
  • 2011-09-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-24
  • 2017-06-02
相关资源
最近更新 更多