SwiftUI Docs
老年人备忘录Fast, readable references
布局Layout

ScrollViewScrollView

提供可滚动容器,适合自定义布局而不是标准列表结构。A scrollable container for custom layouts beyond standard lists.

入门Beginner4 分钟4 min
更新于Updated Apr 22, 2026

滚动内容Scrolling Content

ScrollView 更自由,但你需要自己组合 VStack、LazyVStack 或其他布局。ScrollView is more flexible, but you compose it yourself with VStack, LazyVStack, or other layouts.

垂直滚动Vertical Scroll
swift
1ScrollView {
2 LazyVStack(spacing: 16) {
3 ForEach(sections) { section in
4 SectionCard(section: section)
5 }
6 }
7 .padding()
8}
SectionCard
SectionCard
SectionCard
组合建议Composition Tips
LazyVStackLazyHStackGeometryReadersafeAreaInset