hig-components-content
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseApple HIG: Content Components
Apple HIG:内容组件
Check for before asking questions. Use existing context and only ask for information not already covered.
.claude/apple-design-context.md提问前请查阅文件。请利用已有上下文,仅询问未涵盖的信息。
.claude/apple-design-context.mdKey Principles
核心原则
-
Adapt to different sizes and contexts. Content components must work across screen sizes, orientations, and multitasking configurations. Use Auto Layout and size classes.
-
Make content accessible. Charts need audio graph support. Images need alt text. Collections need proper VoiceOver navigation order. All content components need labels and descriptions.
-
Maintain visual hierarchy. Use spacing, sizing, and grouping to establish clear information hierarchy. Primary content should be visually prominent.
-
Use system components first. Evaluate UICollectionView, SwiftUI Charts, WKWebView before building custom. System components come with built-in accessibility and platform adaptation.
-
Respect platform conventions. A collection on tvOS uses large lockups with parallax. The same collection on iOS uses compact cells with touch targets. On visionOS, content gains depth and hover effects.
-
Handle empty states. Show a meaningful empty state with guidance on how to populate it, not a blank screen.
-
Optimize for performance. Use lazy loading, cell reuse, pagination, and prefetching for large datasets.
-
适配不同尺寸与使用场景。内容组件需适配不同屏幕尺寸、方向及多任务配置。请使用Auto Layout和size classes。
-
确保内容可访问性。图表需支持音频图表功能。图片需添加替代文本。集合类组件需设置正确的VoiceOver导航顺序。所有内容组件都需要标签和描述。
-
维持视觉层级。通过间距、尺寸和分组建立清晰的信息层级。主要内容应在视觉上突出显示。
-
优先使用系统组件。在构建自定义组件前,请先评估UICollectionView、SwiftUI Charts、WKWebView。系统组件内置了可访问性支持和平台适配能力。
-
遵循平台惯例。tvOS上的集合组件使用带视差效果的大型锁定布局。iOS上的同类型集合组件则使用带触摸目标的紧凑单元格。在visionOS上,内容需具备深度感和悬停效果。
-
处理空状态。显示有意义的空状态提示,并说明如何填充内容,而非仅展示空白屏幕。
-
优化性能。对于大型数据集,请使用懒加载、单元格复用、分页和预加载机制。
Reference Index
参考索引
| Reference | Topic | Key content |
|---|---|---|
| charts.md | Charts | Swift Charts, bar/line/area/point marks, chart accessibility, audio graphs |
| collections.md | Collections | Grid/list layouts, compositional layout, selection, reordering, diffable data sources |
| image-views.md | Image Views | Aspect ratio handling, content modes, SF Symbol images, accessibility |
| image-wells.md | Image Wells | Drag-and-drop image selection, macOS-specific, placeholder content |
| color-wells.md | Color Wells | Color selection UI, system color picker, custom color spaces |
| web-views.md | Web Views | WKWebView, SFSafariViewController, navigation controls, content restrictions |
| activity-views.md | Activity Views | Share sheets, activity items, custom activities, action extensions |
| lockups.md | Lockups | Image+text elements, tvOS card layouts, focus effects, shelf layouts |
| 参考文档 | 主题 | 核心内容 |
|---|---|---|
| charts.md | 图表 | Swift Charts,柱状图/折线图/面积图/散点图标记,图表可访问性,音频图表 |
| collections.md | 集合组件 | 网格/列表布局,组合式布局,选择、重排序功能,差分数据源 |
| image-views.md | 图片视图 | 宽高比处理,内容模式,SF Symbol图片,可访问性 |
| image-wells.md | 图片选择框 | 拖拽式图片选择,macOS专属功能,占位内容 |
| color-wells.md | 颜色选择框 | 颜色选择UI,系统颜色选择器,自定义色彩空间 |
| web-views.md | 网页视图 | WKWebView,SFSafariViewController,导航控件,内容限制 |
| activity-views.md | 活动视图 | 分享面板,活动项,自定义活动,动作扩展 |
| lockups.md | 锁定布局 | 图片+文本元素,tvOS卡片布局,焦点效果,货架布局 |
Component Selection Guide
组件选择指南
| Content Need | Recommended Component | Platform Notes |
|---|---|---|
| Visualizing quantitative data | Charts (Swift Charts) | iOS 16+, macOS 13+, watchOS 9+ |
| Browsing a grid or list of items | Collection View | Compositional layout for complex arrangements |
| Displaying a single image | Image View | Support aspect ratio fitting; provide accessibility description |
| Selecting an image via drag or browse | Image Well | macOS primarily; use image pickers on iOS |
| Selecting a color | Color Well | Triggers system color picker; macOS, iOS 14+ |
| Showing web content inline | Web View (WKWebView) | Use SFSafariViewController for external browsing |
| Sharing content to other apps | Activity View | System share sheet with configurable activity types |
| Content card (image + text) | Lockup | Primarily tvOS; adaptable to other platforms |
| 内容需求 | 推荐组件 | 平台说明 |
|---|---|---|
| 可视化量化数据 | Charts (Swift Charts) | iOS 16+, macOS 13+, watchOS 9+ |
| 浏览网格或列表类内容 | Collection View | 复杂布局可使用组合式布局 |
| 展示单张图片 | Image View | 支持宽高比适配;需提供可访问性描述 |
| 通过拖拽或浏览选择图片 | Image Well | 主要适用于macOS;iOS请使用图片选择器 |
| 选择颜色 | Color Well | 触发系统颜色选择器;支持macOS、iOS 14+ |
| 内嵌展示网页内容 | Web View (WKWebView) | 外部浏览请使用SFSafariViewController |
| 向其他应用分享内容 | Activity View | 可配置活动类型的系统分享面板 |
| 内容卡片(图片+文本) | Lockup | 主要适用于tvOS;可适配其他平台 |
Output Format
输出格式
- Component recommendation with rationale, referencing the relevant HIG reference file.
- Configuration guidance -- key properties and setup.
- Accessibility requirements for the recommended component.
- Platform-specific notes for targeted platforms.
- 组件推荐及理由,需引用相关的HIG参考文档。
- 配置指南——关键属性与设置方法。
- 推荐组件的可访问性要求。
- 针对目标平台的特定说明。
Questions to Ask
待确认问题
- What type of content? (Quantitative data, images, web content, browsable collection, share action?)
- Which platforms?
- Static or dynamic content?
- How much content? (Few items vs hundreds/thousands affects component choice and optimization.)
- 内容类型是什么?(量化数据、图片、网页内容、可浏览集合、分享操作?)
- 目标平台有哪些?
- 内容是静态还是动态的?
- 内容量有多少?(少量条目 vs 成百上千条会影响组件选择和优化方案。)
Related Skills
相关技能
- hig-foundations -- Color, typography, accessibility, and image guidelines
- hig-patterns -- Data visualization, sharing, and loading patterns
- hig-components-layout -- Structural containers (scroll views, lists, split views) hosting content
- hig-platforms -- Platform-specific component behavior (lockups on tvOS, web views on macOS)
Built by Raintree Technology · More developer tools
- hig-foundations —— 颜色、排版、可访问性及图片相关指南
- hig-patterns —— 数据可视化、分享及加载模式
- hig-components-layout —— 承载内容的结构化容器(滚动视图、列表、拆分视图)
- hig-platforms —— 平台特定的组件行为(tvOS上的锁定布局、macOS上的网页视图)
When to Use
使用场景
This skill is applicable to execute the workflow or actions described in the overview.
当需要执行概述中描述的工作流或操作时,适用本技能。