Image
An accessible and responsive image component.
This component renders images with flexbox layout and cover
object-fit (rather than stretch
) by default.
import { Image } from 'react-native';
<Image {...props} />;
API
Props
The radius of the blur filter added to the image
A static image to display while loading the image source.
Set whether the image can be dragged with native browser behavior. (Web-only)
Called when the image fails to load.
Called when the image successfully loads.
Called when image loading ends.
Called when the image loading starts.
Determines how the image source is resized to fit the layout of the image element.
The image source. The string can be a path to an external resource or a base64 encoded resource.
Source
Set the styles of the view.
Set the styles of the view.
Set the styles of the view.
Statics
Download an image and measure the width and height (in pixels) prior to displaying it. This method can fail if the image cannot be found, or fails to download.
Complete callback: (width: number, height: number) => void
.
Failure callback: () => void
.
Prefetches a remote image for later use by downloading it. Once an image has been prefetched it is assumed to be in native browser caches and available for immediate rendering.
Performs cache interrogation. Returns a mapping from URL to cache status: “disk”, “memory”, “disk/memory”. If a requested URL is not in the mapping, it means it’s not in the cache.