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.
204elements
View
Container Content Margins
Adds the margins of the container the view is in.
Explore Container Content Margins on iPhone in portrait and landscape, with SwiftUI code and Apple API documentation.
SwiftUI code
VStack(spacing: 0) {
Color.blue
Color.indigo
.contentMargins(
for: .container,
edges: .all
)
List {
Text("FooBar")
}
}Compatibility
iOS 27.1+ iPadOS 27.1+ macOS 27.1+ watchOS 27.1+ visionOS 27.1+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for Container Content Margins.