跳转至
Structure

InsetGroupedListStyle

The instance that describes the behavior and appearance of an inset grouped list.

Declaration

struct InsetGroupedListStyle : ListStyle

Overview

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(InsetGroupedListStyle())
    }
}
A view which contains an inset grouped listwith three text items, "Bananas 🍌🍌","Apples 🍎🍎", and "Peaches 🍑🍑"; the set of list items sit together in a rounded box that is separated by a gap from the edge of the frame.

Availability

iOS 14.0+

Topics


Initializer

init() Creates an inset grouped list style.