init(alignment: HorizontalAlignment , spacing: CGFloat?, pinnedViews : PinnedScrollableViews , content: () -> Content)
Creates a lazy vertical stack view with the given spacing, vertical alignment, pinning behavior, and content.
Availability 有効性
Technology
struct LazyVStack<Content> where Content : View
The stack is “lazy,” in that the stack view doesn’t create items until it needs to render them onscreen.
In the following example, a Scroll
contains a Lazy
that consists of a vertical row of text views. The stack aligns to the leading edge of the scroll view, and uses default spacing between the text views.
ScrollView {
LazyVStack(alignment: .leading) {
ForEach(1...100, id: \.self) {
Text("Row \($0)")
}
}
}
init(alignment: HorizontalAlignment , spacing: CGFloat?, pinnedViews : PinnedScrollableViews , content: () -> Content)
typealias Body
struct LazyHStack
struct PinnedScrollableViews