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.

List

Custom List Section Spacing

Sets the spacing between adjacent sections in a List to a custom value.

Explore Custom List Section Spacing on iPhone in portrait, with SwiftUI code and Apple API documentation.

List {
  Section("Header") {
    Text("Foo")
  }
  Section("Header") {
    Text("Bar")
  }
  .listSectionSpacing(42)
  Section("Header") {
    Text("Foo")
  }
}
iOS 17.0+ iPadOS 17.0+ watchOS 10.0+ visionOS 1.0+

Every available iPhone screenshot for Custom List Section Spacing.

1 views