Usage
Props
ImageBackground accepts all Image props plus the following:Child components to render on top of the background image.
Style applied to the outer View component. This controls the layout and dimensions of the entire ImageBackground.
Style applied to the inner Image component. Use this to style the background image itself (e.g., opacity, resizeMode).
Allows you to set a reference to the inner Image component.
The image source for the background. Can be a remote URL, local file resource, or static image.
Determines how to resize the image when the frame doesn’t match the raw image dimensions.
cover: Scale uniformly (maintain aspect ratio) to fill the viewcontain: Scale uniformly to fit within the viewstretch: Scale width and height independentlyrepeat: Repeat the image to cover the framecenter: Center the image without scaling up
Implementation Details
ImageBackground wraps your content in a View and renders an absolutely positioned Image as the background:style prop, while the background image fills the entire View using StyleSheet.absoluteFill.