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

how to set circle image before click and full when open?

Open kriptonhaz opened this issue 8 years ago • 2 comments

I'm trying just like another popular apps, the image thumbnail is circle and full when on click, how can I achieve this with react-native-lightbox?

this is my code snippet for now

<View style={{flex: 1}}>
	<Lightbox>
		<Image 
			resizeMode="contain"
			style={styles.image}
			source={{uri:uris}}
		/>
	</Lightbox>
</View>

I tried to applied borderRadius on style image, but it's not good enough.

Thanks

kriptonhaz avatar Mar 22 '18 09:03 kriptonhaz

I'm achieving something similar by using the renderContent prop. My use case is to show a low-res image in list items and the high-res in the lightbox. The renderContent function returns the new image component and everything is working as expected.

sellmeadog avatar Apr 12 '18 13:04 sellmeadog

As this issue is still open, I'd like to confirm that the implementation proposed by @sellmeadog works wonderfully.

Here's mine, based on his:


<View style={styles.imgContainer}>
  <Lightbox 
    style={{justifyContent: "center"}}
      renderContent={() => (
        <Image 
          source={{uri: this.state.imageUri}}
          style={{alignSelf: "center", width: 300, height: 300}}
         />
       )}
   >
  <Image
    source={{ uri: this.state.imageUri }}
    style={styles.primaryImg}
  />
  </Lightbox>
</View>

lnghrdntcr avatar May 06 '18 16:05 lnghrdntcr