ScrollView

#scrollview

Overview

Scrollview works Horizontally and Vertically. By default it works as Vertically.

ScrollView(.horizontal) {
HStack{}  // You should use relevant Stack HStack or LazyHStack
}

ScrollView(.vertical) {
VStack{}  // You should use relevant Stack VStack or LazyVStack
}

Sample Codes

To use ScrollView across the screen you should expand it to the whole screen.

.frame(maxWidth: .infinity)

Sources

Videos

Articles / Documents

Last updated