2

I am working the resizeMode:'contain' because the image is stretching. but the resizeMode not working with expo app.

image: {
    width: 80,
    height: 80,
    borderRadius: 10,
    resizeMode:'contain',
  },


<TouchableOpacity onPress={() => onPress({ product })}>
   <Image
     source={{ uri: getProductImage(product.images[0].src, 100) }}
     style={styles.image}
   />
</TouchableOpacity>[enter image description here][1]

screenshot

Community
  • 1
  • 1
Mohit Sharma
  • 529
  • 1
  • 6
  • 17
  • Does this answer your question? [Image 'contain' resizeMode not working in react native](https://stackoverflow.com/questions/36436913/image-contain-resizemode-not-working-in-react-native) – SDushan Apr 07 '20 at 14:24

1 Answers1

2

try to put resizeMode='contain' inside Image component:

<Image
     resizeMode='contain'
     source={{ uri: getProductImage(product.images[0].src, 100) }}
     style={styles.image}
   />

check also this method using flex and `height:undefined': example

B. Mohammad
  • 2,152
  • 1
  • 13
  • 28