Skip to content

Backgrounds

Backgrounds control the area behind a view’s content.

A background can use one of these types:

  • Default background uses the canvas default surface.
  • Solid color sets one color behind the view’s content.
  • Linear gradient draws a gradient behind the view’s content.
  • Background image uses an image behind the view’s content.
A small widget showing content without a visible background surface.A small widget showing content without a visible background surface.
Default
A small widget showing content on a solid background surface.A small widget showing content on a solid background surface.
Solid color
A small widget showing content on a linear gradient background surface.A small widget showing content on a linear gradient background surface.
Linear gradient
A small widget showing content over an image background.A small widget showing content over an image background.
Image

Use a background on a stack when several child views should share the same surface. Use an image view instead when the image is the main content and needs its own frame, crop, or button behavior.