SwiftUI Docs
老年人备忘录Fast, readable references
组件Components

TextText

文本排版的基础组件,适合构建标题、正文、注释和强调信息。The basic text view for titles, body copy, notes, and emphasis.

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

文本基础Text Basics

Text 支持样式链式组合,非常适合构建一致的内容层级。Text supports chained styling and works well for consistent content hierarchy.

排版示例Typography Example
swift
1VStack(alignment: .leading, spacing: 8) {
2 Text("SwiftUI Documentation")
3 .font(.largeTitle.weight(.semibold))
4
5 Text("Fast, readable, and modern.")
6 .foregroundStyle(.secondary)
7}
SwiftUI Documentation
Fast, readable, and modern.
常见样式Common Styles
fontforegroundStylebolditaliclineSpacing