滚动视图无法在React Native的PanResonder内部滚动

时间:2018-12-12 10:19:23

标签: ios react-native scrollview

我使用这个库react-native-swipe-gestures来听左右滑动,在它里面我有scrollview但没有用,  我在问题中进行搜索,发现PanResonder阻止了其他在react-native-swipe-gestures库中实现的交互 代码示例:

        <GestureRecognizer
                // onSwipeUp={(state) =>{}}
                // onSwipeDown={(state) =>{}}
                onSwipeLeft={(state) => this.onSwipeLeft(state)}
                onSwipeRight={(state) => this.onSwipeRight(state)}
                config={{
                    velocityThreshold: 0.5,
                    directionalOffsetThreshold: 100
                }}
                style={Styles.baseContainer}   >

   <ScrollView onScroll={() => console.log('scrolled')} 
               style={styles.scroll_view} >
          <Text style={{fontSize:96}}>Scroll this</Text>
          <Text style={{fontSize:96}}>Scroll this</Text>
          <Text style={{fontSize:96}}>Scroll this</Text>
          <Text style={{fontSize:96}}>Scroll this</Text>
          <Text style={{fontSize:96}}>Scroll this</Text>
        </ScrollView>
</GestureRecognizer>

我需要解决此问题!

0 个答案:

没有答案