react-native-lightbox
react-native-lightbox copied to clipboard
Different resize mode option
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?
I have the same issue
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>