Last updated 2 years ago
struct ContentView: View { var body: some View { // โญ๏ธ horizontal scroll view (default = .vertical) ScrollView(.horizontal) { HStack(spacing: 15) { ForEach(0..<20) { i in ZStack { Color.red Text("\(i)") }.frame(width: 50, height: 50) } } } } }
Sarun โฉ How to use ScrollView in SwiftUI
Michael Amundsen โฉ Every Screen in Your App Should Be a Scrolling View
ScrollVGridForEach - ScrollView + LazyVGrid + ForEach.