0

I have to show a list of network Images having different aspect ratio. I have to maintain the aspect ratio of images with width = 100% of screen size.

sample example:

<ScrollView>
  <Image source={{/* network image url */}} style={{width:100%, height=?}} />
  <Image source={{/* network image url */}} style={{width:100%, height=?}} />
  <Image source={{/* network image url */}} style={{width:100%, height=?}} />
</ScrollView>

I have to specify the height as per the official doc. But what is the best practice to set the height in this case?

Kalpesh Wadekar
  • 1,237
  • 11
  • 19
  • Possible duplicate of [Maintain aspect ratio of image with full width in React Native](https://stackoverflow.com/questions/29642685/maintain-aspect-ratio-of-image-with-full-width-in-react-native) – Val Sep 07 '17 at 07:23
  • Have a look at [react-native-scalable-image](https://www.npmjs.com/package/react-native-scalable-image) – Ihor Burlachenko Jan 18 '18 at 14:34

0 Answers0