Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Why Image.resolveAssetSource() is not returning the height and width in react native?

$
0
0

I recently moved to react native and want to get the size of the uri image. I looked at the react nativedocumentation and found this method:

Image.resolveAssetSource();

When I use it for static images(require()) it works fine and return the height and width property along with other useful properties, but when i use it for the dynamic images({uri: 'www.abc.com/image'}) it only and only returns the uri property containing in the object but not height and width properties.

I was thinking that may be I am doing something wrong, but in fact the documentation mentioned that:

ImageSource is an object like { uri: 'http location || file path' }

Then why it is not working for the uri? Can anyone tell?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>