React Native Image
The Image component is used to display the image on the screen. The image can be loaded from static resources, from temporary local files, from a local disc, from network images, etc.
Static Image Resources
The static images are added in the app by placing it in somewhere in the source code directory and provide the path as:
In the above syntax, the packager will look for icon_name.png in the same folder as the component that requires it. To load the image on a specific platform, it should be named by specifying the platform as extensions such as icon_name.ios.png and icon_name.android.png.
Images from Hybrid App's Resources
The app which is built by using both React Native and platform code are also uses the image that is packaged into the app.
The image included through Xcode asset catalogs and in Android it is placed in the drawable folder. Placing the image in Xcode asset or drawable folder are consumes without their extension.
The images within the Android assets folder, use the scheme: asset:/ with image extension.
The dynamic and network images are also be displayed in the Image component. To access the network image it is required to specify the dimensions of your image manually.
It is recommended to use https in order to satisfy the App Transport Security requirements on iOS.
Uri Data Images
The encoded image data use the "data:" uri scheme in the image. The data image also required to specify the dimension of the image.
Background Image via Nesting
The ImageBackground component is used to set the image in the background. It is also the same props as Image. We can add any component as children on the top of it.
React Native Image Example