DEV Community

zichengbohan
zichengbohan

Posted on

how to make pansponder worked with scorllView's contentView in Android platform

const injectAnim = (Global.experGroup.hotelHighLights && hasGuestShow) ? this.panResponder.panHandlers : {};
Enter fullscreen mode Exit fullscreen mode

scrollEnabled={this.state.scrollEnabled}
disableScrollViewPanResponder={true}
bounces={false}
nestedScrollEnabled={false}
overScrollMode="never"
style={
{
backgroundColor: 'transparent'
}
}
onMoveShouldSetResponder={this.scrollViewOnMoveShouldSetResponder}
onTouchStart={() => {
console.log('点击开始:');
this.setState({
scrollEnabled: true
})
}}
>
style={[
this.pan.getLayout(),
{
opacity: this.state.baseInfoOpacity
}
]}
{...injectAnim}
>

the panResponder is work when scrollEnabled=false, but it's not work when scrollEnabled=true and call onPanResponderTerminate method
someone will help me?

Top comments (0)