SwiftUI Docs
老年人备忘录Fast, readable references
分类Category

布局Layout

理解栈布局、网格和自适应容器,快速搭建结构清晰的界面。Understand stacks, grids, and adaptive containers for clear interface structure.

入门Beginner3 分钟3 min

VStackVStack

垂直方向排列多个子视图,适合表单、详情页和内容流布局。Arranges child views vertically for forms, detail pages, and content flows.

spacingalignmentframe
更新于Updated Apr 22, 2026
入门Beginner3 分钟3 min

HStackHStack

水平方向排列视图,适合工具栏、标签行和操作区。Arranges views horizontally for toolbars, label rows, and action areas.

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

ZStackZStack

在同一平面上叠放多个视图,适合背景、浮层和徽标效果。Layers views on top of each other for backgrounds, overlays, and badges.

overlaybackgroundalignmentlayers
更新于Updated Apr 22, 2026
入门Beginner3 分钟3 min

SpacerSpacer

在布局中占据可用空白空间,常用于推开视图或构建弹性间距。Consumes available space to push views apart and create flexible gaps.

flexiblespacelayoutminLength
更新于Updated Apr 22, 2026
中级Intermediate5 分钟5 min

LazyVGridLazyVGrid

构建自适应网格布局,适合相册、卡片列表和仪表盘。Builds adaptive grids for galleries, card lists, and dashboards.

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

ScrollViewScrollView

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

axisshowsIndicatorslazycontent
更新于Updated Apr 22, 2026