Expo UI and Router for iOSExpo SDK 57 and later, iOS only
Modifiers

background

Sets the background of a view.

background(color, shape)

ParameterTypeDescription
colorColorThe background color (hex string). For example, #FF0000.
shape(optional)ShapeOptional shape to clip the background. If not provided, the background will fill the entire view.

Sets the background of a view.

Returns: ModifierConfig

See: Official SwiftUI documentation.

Works with

You can add background to any view. It changes what you see on 38 of the 39 components.

Needs care

It works on these components, but not in the way that you may expect.

ComponentWhat to know
ListList and Form draw their own background on top. Add scrollContentBackground('hidden') to see it.
FormList and Form draw their own background on top. Add scrollContentBackground('hidden') to see it.
SectionIt changes the whole section, not one row. For one row, put it on the view in the row.

No visible effect

These components accept it, but you see no change.

ComponentWhy nothing happens
SpacerIt paints in the area of the view, and Spacer draws nothing that you can see.

Sources

The original Expo docs for this page:

On this page