I'm trying to render a bunch of network images of various sizes (unknown at runtime). In web CSS I can do the following:
div.container {
display: flex
flex-wrap: wrap
}
div.container img {
max-height: 250px;
max-width: 100%;
margin: 0 5px 5px 0;
vertical-align: top;
}
And the images will be laid out nicely.
In React Native, however, <Image />
never tries to set its dimensions to the actual size of the image. It leaves it at 0 by 0 unless you specify something manually. I can't really specify something manually because I do not know the dimensions of the image.
Any ideas of how I can achieve something similar to max-height, max-width for images in React Native?