0

使用此处找到的建议示例代码https://github.com/dancormier/react-native-swipeout/blob/master/example/SwipeoutExample.js#L46

每当我TouchableWithoutFeedback启用时,我都无法滑动。

这是我的代码:

    return (
      <Swipeout
        right={swipeoutBtns}
        rowID={0}
        sectionID={0}
        autoClose={true}
        backgroundColor="white"
        onOpen={(sectionID, rowID) => {
          this.setState({
            sectionID,
            rowID
          });
        }}
        onClose={() => console.log("===close")}
        scroll={event => console.log("scroll event")}
      >
        <TouchableWithoutFeedback onPress={() => console.log("press children")}>
          <View style={{ height: 100 }}>
            <Text style={styles.liText}>yo</Text>
          </View>
        </TouchableWithoutFeedback>
      </Swipeout>
    );

任何帮助将不胜感激。谢谢!

如果有帮助,这是我的信息

 react-native info
info 
  React Native Environment Info:
    System:
      OS: macOS 10.14.6
      CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
      Memory: 226.37 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    IDEs:
      Android Studio: 3.4 AI-183.5429.30.34.5452501
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.4 => 0.59.4 
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1
4

1 回答 1

0

对于遇到此问题的任何人。如果 Swipeout 在抽屉导航器内,则必须禁用该导航上的手势。

在导航选项里面添加drawerLockMode: "locked-open"

于 2019-06-13T14:04:59.623 回答