首页 > 解决方案 > 如何使用 react-native 实现 Word-Link 游戏中使用的滑动手势

问题描述

我正在尝试制作类似于 Word-Link 的游戏。我想在多个字母之间滑动并创建一个单词。我如何在 React-Native 中实现这一点。我的一个想法是使用模式锁定系统,但我仍在发布此查询以查找是否有更好的方法来做到这一点。目前我正在使用 ToucableOpacity 按下按钮并生成单词。[1]:https ://i.stack.imgur.com/z4iKW.jpg

            <TouchableOpacity
          onPress={() => {
            this.addLetters(alpha4[0])
            // Alert.alert("A")
            box1 = alpha4[0]

            this.setState({ box1: box1 })
          }}
        >
          <View style={{ width: 50, height: 50, backgroundColor: 'beige' }}>
        <Text style={{ fontSize: 30, fontWeight: 'bold', justifyContent: 'center', textAlignVertical: 'center', textAlign: 'center', borderWidth: 5 }}>{alpha4[0]}</Text>
          </View>
        </TouchableOpacity>

标签: androidnode.jsreact-nativeswipemulti-touch

解决方案



推荐阅读