---
title: "background(ignoresSafeAreaEdges:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/background(ignoressafeareaedges:)"
---

# background(ignoresSafeAreaEdges:)

Sets the view’s background to the default background style.

## Declaration

```swift
nonisolated func background(ignoresSafeAreaEdges edges: Edge.Set = .all) -> some View

```

## Parameters

- `edges`: The set of edges for which to ignore safe area insets when adding the background. The default value is doc://com.apple.SwiftUI/documentation/SwiftUI/Edge/Set/all. Specify an empty set to respect safe area insets on all edges.

## Return Value

Return Value A view with the background shape style drawn behind it.

## Discussion

Discussion This modifier behaves like background(_:ignoresSafeAreaEdges:), except that it always uses the background shape style. For example, you can add a background to a Label: ZStack {     Color.teal     Label("Flag", systemImage: "flag.fill")         .padding()         .background() } Without the background modifier, the teal color behind the label shows through the label. With the modifier, the label’s text and icon appear backed by a region filled with a color that’s appropriate for light or dark appearance:

If you want to specify a View or a stack of views as the background, use background(alignment:content:) instead. To specify a Shape or InsettableShape, use background(_:in:fillStyle:). To configure the background of a presentation, like a sheet, use presentationBackground(_:).

## See Also

### Layering views

- [Adding a background to your view](swiftui/adding-a-background-to-your-view.md)
- [ZStack](swiftui/zstack.md)
- [zIndex(_:)](swiftui/view/zindex(_:).md)
- [background(alignment:content:)](swiftui/view/background(alignment:content:).md)
- [background(_:ignoresSafeAreaEdges:)](swiftui/view/background(_:ignoressafeareaedges:).md)
- [background(_:in:fillStyle:)](swiftui/view/background(_:in:fillstyle:).md)
- [background(in:fillStyle:)](swiftui/view/background(in:fillstyle:).md)
- [overlay(alignment:content:)](swiftui/view/overlay(alignment:content:).md)
- [overlay(_:ignoresSafeAreaEdges:)](swiftui/view/overlay(_:ignoressafeareaedges:).md)
- [overlay(_:in:fillStyle:)](swiftui/view/overlay(_:in:fillstyle:).md)
- [backgroundMaterial](swiftui/environmentvalues/backgroundmaterial.md)
- [containerBackground(_:for:)](swiftui/view/containerbackground(_:for:).md)
- [containerBackground(for:alignment:content:)](swiftui/view/containerbackground(for:alignment:content:).md)
- [ContainerBackgroundPlacement](swiftui/containerbackgroundplacement.md)
