跳转至
Structure

SidebarListStyle

The behavior and appearance of a sidebar or source list.

Declaration

struct SidebarListStyle : ListStyle

Overview

struct ExampleView: View {
    var body: some View {
        List {
            Text("Bananas 🍌🍌")
            Text("Apples 🍎🍎")
            Text("Peaches 🍑🍑")
        }
        .listStyle(SidebarListStyle())
    }
}
A view diplaying a sidebar list with three items "Bananas 🍌🍌", "Apples 🍎🍎", "Peaches 🍑🍑", which are right aligned and separated by spacing.

Availability

iOS 14.0+

macOS 10.15+

Topics


Initializer

init() Creates a sidebar list style.