init(alignment: VerticalAlignment , spacing: CGFloat?, pinnedViews : PinnedScrollableViews , content: () -> Content)
Creates a lazy horizontal stack view with the given spacing, vertical alignment, pinning behavior, and content.
Availability 有効性
Technology
struct LazyHStack<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 horizontal row of text views. The stack aligns to the top of the scroll view and uses 10-point spacing between each text view.
ScrollView(.horizontal) {
LazyHStack(alignment: .top, spacing: 10) {
ForEach(1...100, id: \.self) {
Text("Column \($0)")
}
}
}
init(alignment: VerticalAlignment , spacing: CGFloat?, pinnedViews : PinnedScrollableViews , content: () -> Content)
typealias Body
struct LazyVStack
struct PinnedScrollableViews