← ClaudeAtlas

apple-human-interface-guidelines-typographylisted

Apple HIG Typography和Layout:Android 映射 dimens.xml;iOS 用 SwiftUI Dynamic Type + 应用级 dimens 封装。Invoke when implementing iOS-style UI in Android OR governing iOS layout/typography in SwiftUI.
OPN48/skills-apple-human-interface-guidelines · ★ 0 · Web & Frontend · score 62
Install: claude install-skill OPN48/skills-apple-human-interface-guidelines
# Apple Human Interface Guidelines - Typography & Layout > **平台分流** > > - **Android**:下文 dimens.xml / TextStyle 映射章节 > - **iOS**:**禁止**照搬 Android dimens;改用 SwiftUI Dynamic Type + 应用级 dimens 封装(见 [iOS SwiftUI 实施方案](#ios-swiftui-实施方案)) --- ## iOS SwiftUI 实施方案 iOS 客户端 typography / layout 遵循 [Apple HIG Typography](https://developer.apple.com/design/human-interface-guidelines/typography) 与 [Apple HIG Layout](https://developer.apple.com/design/human-interface-guidelines/layout)。 ### 创建字号与字重的优先级 1. SwiftUI **Dynamic Type** 文本样式:`.largeTitle`、`.title`、`.title2`、`.title3`、`.headline`、`.body`、`.callout`、`.subheadline`、`.footnote`、`.caption`、`.caption2` 2. 字重修饰:`.bold()`、`.semibold()`、`.medium()`(避免 Thin/Light 用于小字) 3. 域级封装:应用级 `Typography` / `Spacing` 等语义别名(返回 `Font`,非固定 pt) 4. 固定 `Font.system(size:)` — 仅 SF Symbol 图标等特殊场景 **禁止**(业务 UI): - 硬编码固定 pt 的 design token 替代 Dynamic Type - Android `text_body_m`、`layout_height_l` 等 dimen 名直接照搬 - `Font.system(size: 14)` 作正文/按钮/Tab 标签 - 固定 pt 刻度表替代 Dynamic Type ### Dynamic Type 层级(标准) | HIG Style | SwiftUI Font | 典型用途 | | ----------- | -------------------------------- | --------- | | Large Title | `.largeTitle` | 页面主标题 | | Title 1–3 | `.title` / `.title2` / `.title3` | 章节/卡片标题 | | Headline | `.headline` | 主按钮、列表标题 | | Body | `.body` | 正文 | | Callout | `.callout` | 辅助说明 | | Subhead | `.s