ascoders / react-native-image-viewer

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

BackHandler to close support ? #344

Open habibiazmi123 opened 4 years ago

habibiazmi123 commented 4 years ago

does this library support BackHandler to close?

jurisjansons commented 4 years ago

@habibiazmi123 You should use Modal element back handler. I am using react-native-modal like this:

` <Modal isVisible={this.state.isModalVisible} onBackButtonPress={this.toggleModal}

<ImageViewer imageUrls={this.state.images} onSwipeDown={this.toggleModal} backgroundColor="transparent" enableSwipeDown={true} /> `

dev-jonghoonpark commented 4 years ago

in my case, onBackButtonPress not worked. but, onRequestClose worked

https://github.com/react-native-community/react-native-modal/issues/115#issuecomment-522228717