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

Different resize mode option

Open Karthik-B-06 opened this issue 2 years ago • 2 comments

I want to the resize mode of the Image to be cover when in initial state so that it fills the container. While tapped and in light box modal, I want the whole image to be contained within the height-width of the screen. How can I achieve this?

Karthik-B-06 avatar Jan 29 '24 07:01 Karthik-B-06

I have the same issue

ansh avatar Apr 04 '24 23:04 ansh

what I did:

styles:

const styles = StyleSheet.create({
  imageStyle: {
    borderRadius: 12,
    overflow: 'hidden',
    objectFit: 'contain',
  },
});

image element:

<LightBox
        width={width / 3}
        height={width / 3}
        imgLayout={{ width: width, height: width }}>
                <Image
                   source={{
                     uri: uri,
                     cache: 'force-cache',
                }}
                  style={[
                  StyleSheet.absoluteFillObject,
                styles.imageStyle,
             ]}
              />
            </LightBox>

rxgfred avatar Jun 08 '24 15:06 rxgfred