Image Resize Mode In React Native. A react native module that can create scaled versions of local images also supports the assets library on ios. Also if you have my icon ios png and my icon android png the bundler will pick the correct file for the platform.
Image resizing in react native. Resizemode and resizemethod are 2 properties that the image component has in rn. Yarn add react native image resizer cd ios pod install.
Zvona s solution is good although you need to bear in mind that onlayout will give you the image view size the image is rendered in but not the actual image size being loaded.
In the example above the bundler will look for my icon png in the same folder as the component that requires it. A software operation which changes the encoded image in memory before it gets decoded this should be used instead of scale when the image is much larger than the view. Yarn add react native image resizer cd ios pod install. A common feature request from developers familiar with the web is background image to handle this use case you can use the imagebackground component which has the same props as image and add whatever children to it you would like to layer on top of it.