Structure¶
InsetListStyle¶
The behavior and appearance of an inset list.¶
Declaration¶
struct InsetListStyle : ListStyle
Overview¶
Use the listStyle(_:) modifier to apply this list style to a List. This style creates a gap between the borders of the list and the edge of the screen:
struct ExampleView: View {
var body: some View {
List {
Text("Bananas 🍌🍌")
Text("Apples 🍎🍎")
Text("Peaches 🍑🍑")
}
.listStyle(InsetListStyle())
}
}

Availability¶
iOS 14.0+
macOS 11.0+
Topics¶
Initializer¶
init() Creates an inset list style.