ascoders / react-native-image-viewer

🚀 tiny & fast lib for react native image viewer pan and zoom
MIT License
2.45k stars 580 forks source link

swipe left/right doesn't work over header and footer #331

Open tarun-khanna opened 5 years ago

tarun-khanna commented 5 years ago

Hi all, i am rendering a custom header and a custom footer through renderFooter and renderHeader props. My custom footer covers 40% of SCREEN_HEIGHT, so when i have to swipe to next image, the swipe gesture doesn't work over footer or header.

here is my code:

Custom footer

renderModalFooter(index){
return(
<View style={{flex: 1, width: SCREEN_WIDTH}}>
  // children covering  40% of SCREEN_HEIGHT 
 </View>
  )
}

Custom Header

renderModalHeader(index){
return(
<View style={{position: "absolute", top: 0, left: 0, right: 0, zIndex: 1}}> 
// children covering 10% of SCREEN_HEIGHT
</View>
  )
}

ImageViewer component

<ImageViewer
  enableSwipeDown
  imageUrls={arr}
  index={activeIndex}
  renderHeader={currentIndex => this.renderModalHeader(currentIndex)}
  renderFooter={currentIndex => this.renderModalFooter(currentIndex)}
  renderIndicator={() => null}
/>;

How can i fix this or are there any other possible workarounds for my problem ?

enri90 commented 5 years ago

up swipe left/right not work

enri90 commented 5 years ago

flipThreshold | number | no | Swipe threshold of the next page | 80 maxOverflow | number | no | The X position maximum, that current page can slide to the next page | 300

tarun-khanna commented 5 years ago

flipThreshold | number | no | Swipe threshold of the next page | 80 maxOverflow | number | no | The X position maximum, that current page can slide to the next page | 300

this doesn't solve my problem.