react-native-lightbox icon indicating copy to clipboard operation
react-native-lightbox copied to clipboard

can i swipe few images as gallery?

Open roysG opened this issue 9 years ago • 7 comments

I mean if i have few image on the page and i click on one of them, can i swipe with the hand to the next image?

roysG avatar Sep 20 '16 07:09 roysG

@shidhincr My question is also same. Can we open image and slide as facebook did with multiple image view slide?

prashen avatar Oct 02 '16 18:10 prashen

@anyone find any solutions?

waleedarshad-vf avatar Oct 14 '16 14:10 waleedarshad-vf

I think there is already a solution! react-native-lightbox itself using carousel inside their example https://github.com/oblador/react-native-lightbox/blob/master/Example/app.js. You need to use page swipe and it will smooth gallery see example in the looped carousel plugin https://github.com/appintheair/react-native-looped-carousel#usage.

I have used only react-native-looped-carousel inside react-native native modal component and it's working fine and smooth. I have created a facebook type image popup and image swipe.

prashen avatar Oct 15 '16 18:10 prashen

@prashen thanks for the hint. I've looked into it. It works but not in the way I want. The list of items in Carousel content is not the content from the list that wraps lightbox, a scrollview for instance. You have to duplicate the content of the scrollview to make it work. This reduces the performance a lot. I hope in future release, we'll swipe left/right integrated into lightbox.

anhreg avatar May 16 '17 07:05 anhreg

@anhreg Did you end up finding a better way to do this? I'm also looking for a more performant solution.

kashav avatar Jul 29 '17 05:07 kashav

Maybe it's too late, but I think you can use the renderItem function and pass the position of the item and in the render function use a map with the array to create the carousel components.

<FlatList
  horizontal
  data={Object.values(album.items)}
  renderItem={({ item, index }) => (
    <Lightbox activeProps={activeProps} renderContent={renderCarousel(index)}>
      <Image source={{ uri: item.URL }}/>
    </Lightbox>
  )}
  keyExtractor={(item, index) => index}
/>

Cheers!

hoscarcito avatar Jan 10 '18 08:01 hoscarcito

Thanks @hoscarcito Your idea is good. But renderContent props is function, is not object. do you have idea to fix this ? Cheers!

WhiteRose7-pretty avatar Oct 03 '22 15:10 WhiteRose7-pretty