Issue with dynamically changing Images

Hi,

I am building a simple app in which I take a photo and then show it in an Image component. I am using an App variable for the file location which works fine but I would also like to use the image with 100% width and 100% height settings.
Unfortunately it looks like the image size is not recalculated in the layout as I only get a thin line of a few pixels shown with height=100%. (the image is empty initially)
It works well if I set the height with static properties like 500px.
Is there a way to tell the page/image to recalculate the layout based on the new image?

Thanks and best,
Jo

Hi!

I’m afraid I don’t know with the 100% height if it would work. I would try to just have the 100% width and leave the height unset, but if you must set it, then it has to be static. I’m not sure, but my understanding is that this is a react native issue that image height is better explicitly (staticly) defined. If setting it to a static height doesn’t work for you, let me know and I’ll see if there’s any hope to getting this fixed, but I’m unsure if it can be :grimacing:

Thank you! Will try it with a static height then.

1 Like