iPhone SwiftUI layouts

Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.

View

Navigation Container Background

Sets the container background of the enclosing container using a view.

Explore Navigation Container Background on iPhone in portrait, with SwiftUI code and Apple API documentation.

NavigationStack {
            Text("Foo")
                .containerBackground(.blue.gradient, for: .navigation)
        }
iOS 17.0+ iPadOS 17.0+ macOS 14.0+ watchOS 1.0+ tvOS 17.0+ visionOS 1.0+

Every available iPhone screenshot for Navigation Container Background.

1 views