axiom-liquid-glass-ref

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Liquid Glass Adoption — Reference Guide

Liquid Glass 适配参考指南

When to Use This Skill

何时使用本指南

Use when:
  • Planning comprehensive Liquid Glass adoption across your entire app
  • Auditing existing interfaces for Liquid Glass compatibility
  • Implementing app icon updates with Icon Composer
  • Understanding platform-specific Liquid Glass behavior (iOS, iPadOS, macOS, tvOS, watchOS)
  • Migrating from previous materials (blur effects, custom translucency)
  • Ensuring accessibility compliance with Liquid Glass interfaces
  • Reviewing search, navigation, or organizational component updates
适用于以下场景:
  • 计划在整个应用中全面采用Liquid Glass
  • 审核现有界面的Liquid Glass兼容性
  • 使用Icon Composer实现应用图标更新
  • 了解不同平台(iOS、iPadOS、macOS、tvOS、watchOS)的Liquid Glass特性
  • 从旧版材质(模糊效果、自定义半透明)迁移
  • 确保Liquid Glass界面符合无障碍合规要求
  • 检查搜索、导航或组织类组件的更新

Related Skills

相关技能

  • Use
    axiom-liquid-glass
    for implementing the Liquid Glass material itself and design review pressure scenarios
  • Use
    axiom-swiftui-performance
    for profiling Liquid Glass rendering performance
  • Use
    axiom-accessibility-diag
    for accessibility testing

  • 如需实现Liquid Glass材质本身并进行设计评审压力场景测试,请使用
    axiom-liquid-glass
  • 如需分析Liquid Glass渲染性能,请使用
    axiom-swiftui-performance
  • 如需进行无障碍测试,请使用
    axiom-accessibility-diag

Overview

概述

Adopting Liquid Glass doesn't mean reinventing your app from the ground up. Start by building your app in the latest version of Xcode to see the changes. If your app uses standard components from SwiftUI, UIKit, or AppKit, your interface picks up the latest look and feel automatically on the latest platform releases.
采用Liquid Glass并不意味着要彻底重构您的应用。首先使用最新版本的Xcode构建应用,查看相关变化。如果您的应用使用SwiftUI、UIKit或AppKit的标准组件,在最新平台版本上,界面会自动获得最新的外观和交互体验。

Key Adoption Strategy

核心适配策略

  1. Build with latest Xcode SDKs
  2. Run on latest platform releases
  3. Review changes using this reference
  4. Adopt best practices incrementally

  1. 使用最新Xcode SDK构建
  2. 在最新平台版本上运行
  3. 参考本指南查看变化
  4. 逐步采用最佳实践

Visual Refresh

视觉更新

What Changes Automatically

自动更新的内容

Standard Components Get Liquid Glass

标准组件自动适配Liquid Glass

  • Navigation bars, tab bars, toolbars
  • Sheets, popovers, action sheets
  • Buttons, sliders, toggles, and controls
  • Sidebars, split views, menus
  • 导航栏、标签栏、工具栏
  • 表单弹窗、弹出框、操作列表
  • 按钮、滑块、开关及其他控件
  • 侧边栏、分栏视图、菜单

How It Works

实现原理

  • Liquid Glass combines optical properties of glass with fluidity
  • Forms distinct functional layer for controls and navigation
  • Adapts in response to overlap, focus state, and environment
  • Helps bring focus to underlying content
  • Liquid Glass融合了玻璃的光学特性与流体特性
  • 为控件和导航创建独立的功能层
  • 会根据重叠情况、焦点状态和环境自适应调整
  • 帮助用户聚焦底层内容

Leverage System Frameworks

充分利用系统框架

✅ DO: Use Standard Components

✅ 推荐:使用标准组件

Standard components from SwiftUI, UIKit, and AppKit automatically adopt Liquid Glass with minimal code changes.
swift
// ✅ Standard components get Liquid Glass automatically
NavigationView {
    List(items) { item in
        Text(item.name)
    }
    .toolbar {
        ToolbarItem {
            Button("Add") { }
        }
    }
}
// Recompile with Xcode 26 → Liquid Glass applied
SwiftUI、UIKit和AppKit的标准组件只需极少代码改动,就能自动适配Liquid Glass。
swift
// ✅ 标准组件自动适配Liquid Glass
NavigationView {
    List(items) { item in
        Text(item.name)
    }
    .toolbar {
        ToolbarItem {
            Button("Add") { }
        }
    }
}
// 使用Xcode 26重新编译 → 自动应用Liquid Glass

❌ DON'T: Override with Custom Backgrounds

❌ 避免:自定义背景覆盖

swift
// ❌ Custom backgrounds interfere with Liquid Glass
NavigationView { }
    .background(Color.blue.opacity(0.5)) // Breaks Liquid Glass effects
    .toolbar {
        ToolbarItem { }
            .background(LinearGradient(...)) // Overlays system effects
    }
swift
// ❌ 自定义背景会干扰Liquid Glass效果
NavigationView { }
    .background(Color.blue.opacity(0.5)) // 破坏Liquid Glass效果
    .toolbar {
        ToolbarItem { }
            .background(LinearGradient(...)) // 覆盖系统效果
    }

What to Audit

需审核的内容

  • Split views
  • Tab bars
  • Toolbars
  • Navigation bars
  • Any component with custom background/appearance
Solution Remove custom effects and let the system determine background appearance.
  • 分栏视图
  • 标签栏
  • 工具栏
  • 导航栏
  • 任何带有自定义背景/外观的组件
解决方案 移除自定义效果,让系统决定背景外观。

Test with Accessibility Settings

结合无障碍设置测试

Settings That Affect Liquid Glass

影响Liquid Glass的设置

  • Reduce Transparency (makes glass frostier)
  • Increase Contrast (makes elements predominantly black/white)
  • Reduce Motion (decreases animation intensity)
  • 降低透明度(使玻璃效果更 Frosty)
  • 增加对比度(使元素以黑白色调为主)
  • 减少动态效果(降低动画强度)

Testing Checklist

测试清单

  • Enable Reduce Transparency → verify frosted appearance works
  • Enable Increase Contrast → verify contrasting borders appear
  • Enable Reduce Motion → verify elastic properties disabled
  • All settings → verify legibility maintained
  • Standard components adapt automatically
  • Custom elements provide fallback experience
  • 启用降低透明度 → 验证磨砂外观正常
  • 启用增加对比度 → 验证对比边框正常显示
  • 启用减少动态效果 → 验证弹性特性已禁用
  • 所有设置下 → 验证内容可读性不受影响
  • 标准组件自动适配
  • 自定义元素提供降级体验

How to Test

测试方法

swift
// Launch arguments for accessibility testing
app.launchArguments += [
    "-UIAccessibilityIsReduceTransparencyEnabled", "1",
    "-UIAccessibilityButtonShapesEnabled", "1",
    "-UIAccessibilityIsReduceMotionEnabled", "1"
]
swift
// 无障碍测试的启动参数
app.launchArguments += [
    "-UIAccessibilityIsReduceTransparencyEnabled", "1",
    "-UIAccessibilityButtonShapesEnabled", "1",
    "-UIAccessibilityIsReduceMotionEnabled", "1"
]

Avoid Overusing Liquid Glass

避免过度使用Liquid Glass

❌ DON'T: Apply to Every Custom Control

❌ 避免:为所有自定义控件应用Liquid Glass

Liquid Glass seeks to bring attention to underlying content. Overusing this material in multiple custom controls distracts from content and provides subpar user experience.
Liquid Glass的设计目的是引导用户关注底层内容。在多个自定义控件上过度使用该材质会分散用户注意力,导致不佳的用户体验。

✅ DO: Limit to Important Functional Elements

✅ 推荐:仅用于重要功能元素

swift
// ✅ Selective application to navigation layer
struct ContentView: View {
    var body: some View {
        ZStack {
            // Content layer - no glass
            ScrollView {
                ForEach(articles) { article in
                    ArticleCard(article) // No glass
                }
            }

            // Navigation layer — Liquid Glass
            VStack {
                Spacer()
                HStack {
                    Button("Filter") { }
                        .glassEffect() // ✅ Important functional element
                    Spacer()
                    Button("Sort") { }
                        .glassEffect() // ✅ Important functional element
                }
                .padding()
            }
        }
    }
}

swift
// ✅ 选择性应用于导航层
struct ContentView: View {
    var body: some View {
        ZStack {
            // 内容层 - 不使用玻璃效果
            ScrollView {
                ForEach(articles) { article in
                    ArticleCard(article) // 无玻璃效果
                }
            }

            // 导航层 — 使用Liquid Glass
            VStack {
                Spacer()
                HStack {
                    Button("Filter") { }
                        .glassEffect() // ✅ 重要功能元素
                    Spacer()
                    Button("Sort") { }
                        .glassEffect() // ✅ 重要功能元素
                }
                .padding()
            }
        }
    }
}

App Icons

应用图标

App icons now take on a design that's dynamic and expressive. Updates to the icon grid result in standardized iconography that's visually consistent across devices. App icons contain layers that dynamically respond to lighting and visual effects.
应用图标采用了更具动态感和表现力的设计。图标网格的更新实现了跨平台的视觉一致性,图标包含可动态响应光线和视觉效果的分层结构。

Platform Support

平台支持

Layered Icons

分层图标

  • iOS 26+
  • iPadOS 26+
  • macOS Tahoe+
  • watchOS (rounded rectangle → circular mask)
  • iOS 26+
  • iPadOS 26+
  • macOS Tahoe+
  • watchOS(从圆角矩形变为圆形遮罩)

Appearance Variants

外观变体

  • Default (light)
  • Dark
  • Clear
  • Tinted (Home Screen personalization)
  • 默认(浅色)
  • 深色
  • 透明
  • 着色(主屏幕个性化设置)

Design Principles

设计原则

Key Principles

核心原则

  1. Visually consistent across platforms
  2. Optically balanced design
  3. Simplified design with solid, filled, overlapping semi-transparent shapes
  4. Let system handle effects (masking, blurring, reflection, refraction)
  1. 跨平台视觉一致
  2. 光学平衡的设计
  3. 简化设计,使用实心、填充、重叠的半透明形状
  4. 让系统处理效果(遮罩、模糊、反射、折射)

❌ DON'T: Include System Effects in Design

❌ 避免:在设计中包含系统效果

❌ Design includes:
   - Pre-applied blur
   - Manual shadows
   - Hardcoded highlights
   - Fixed masking
❌ 设计包含以下内容:
   - 预先添加的模糊效果
   - 手动添加的阴影
   - 硬编码的高光
   - 固定遮罩

✅ DO: Design Clean Layers

✅ 推荐:设计清晰的分层结构

✅ Design includes:
   - Clean vector shapes
   - Solid fills
   - Semi-transparent overlays
   - Foreground/middle/background separation

   System automatically adds:
   - Reflection, refraction
   - Shadow, blur, axiom-highlights
   - Masking to final shape
✅ 设计包含以下内容:
   - 清晰的矢量图形
   - 实心填充
   - 半透明叠加层
   - 前景/中间层/背景层分离

   系统会自动添加:
   - 反射、折射
   - 阴影、模糊、axiom-highlights
   - 最终形状的遮罩

Design Using Layers

分层设计

Layer Structure

图层结构

  • Foreground Layer: Primary visual elements
  • Middle Layer: Supporting elements
  • Background Layer: Foundation elements
  • 前景层:主要视觉元素
  • 中间层:辅助元素
  • 背景层:基础元素

Export from Design App

从设计工具导出

Export settings:
- Format: PNG or vector (SVG recommended)
- Resolution: @1x, @2x, @3x
- Transparency: Preserved
- One file per layer
导出设置:
- 格式:PNG或矢量图(推荐SVG)
- 分辨率:@1x、@2x、@3x
- 透明度:保留
- 每个图层单独导出为一个文件

System-Applied Effects

系统自动应用的效果

  • Reflection (light bouncing off surface)
  • Refraction (light bending through material)
  • Shadow (depth and elevation)
  • Blur (atmospheric depth)
  • Highlights (light sources)
  • 反射(光线在表面的反射)
  • 折射(光线穿过材质的折射)
  • 阴影(体现深度和层级)
  • 模糊(营造空间深度)
  • 高光(光源效果)

Icon Composer

Icon Composer

Compose and Preview

组合与预览

Icon Composer app (included in Xcode 26+):
  1. Drag and drop exported layers
  2. Add background (optional - system provides default for irregular shapes)
  3. Create layer groupings
  4. Adjust layer attributes (opacity, position, scale)
  5. Preview with system effects and appearance variants
Icon Composer应用(Xcode 26+ 内置):
  1. 拖拽导出的图层
  2. 添加背景(可选,系统会为不规则形状提供默认背景)
  3. 创建图层分组
  4. 调整图层属性(透明度、位置、缩放)
  5. 预览系统效果和外观变体

Download Icon Composer

下载Icon Composer

Capabilities

功能特性

  • Real-time preview with system effects
  • Light/dark/clear/tinted appearance previews
  • Layer management (order, opacity, grouping)
  • Export asset catalog directly
  • 实时预览系统效果
  • 浅色/深色/透明/着色外观预览
  • 图层管理(顺序、透明度、分组)
  • 直接导出资源目录

Preview Against Updated Grids

对照更新后的网格预览

Grid Updates

网格更新

  • iOS/iPadOS/macOS: Rounded rectangle mask
  • watchOS: Circular mask
  • iOS/iPadOS/macOS:圆角矩形遮罩
  • watchOS:圆形遮罩

What to Check

检查要点

  • Keep elements centered to avoid clipping
  • Irregular shapes receive system-provided background
  • Test at all sizes (small, medium, large)
  • 元素居中,避免被裁剪
  • 不规则形状会自动使用系统提供的背景
  • 在所有尺寸(小、中、大)下测试

Download Grids

下载网格

Testing Checklist

测试清单

  • Icon centered within grid
  • No critical elements clipped by mask
  • Looks good at all sizes
  • Appears balanced with system-provided background (if irregular)
  • All appearance variants (light/dark/clear/tinted) look intentional
  • 图标在网格中居中
  • 关键元素未被遮罩裁剪
  • 在所有尺寸下显示正常
  • 不规则形状搭配系统背景时视觉平衡
  • 所有外观变体(浅色/深色/透明/着色)效果符合预期

Example Issue

示例问题

❌ Problem: Logo text clipped at edges
✅ Solution: Center design, reduce size to fit safe area

❌ 问题:Logo文字边缘被裁剪
✅ 解决方案:居中设计,缩小尺寸以适配安全区域

Controls

控件

Controls have refreshed look across platforms and come to life during interaction. Knobs transform into Liquid Glass during interaction, buttons fluidly morph into menus/popovers. Hardware shape informs curvature of controls (rounder forms nestle into corners).
控件在各平台上的外观已更新,交互时更具生动性。旋钮在交互时会转换为Liquid Glass效果,按钮可流畅变形为菜单/弹出框。硬件的形状会影响控件的曲率(更圆润的形状贴合边角)。

Updated Appearance

更新后的外观

What Changed

变化内容

  • Bordered buttons default to capsule shape (mini/small/medium on macOS retain rounded-rectangle for density)
  • Rounder forms (inspired by hardware curvature)
  • Knobs transform into Liquid Glass during interaction
  • Buttons morph into menus/popovers
  • Extra-large size option for labels and accents (
    controlSize(.extraLarge)
    )
  • Control heights slightly taller on macOS (more breathing room, larger click targets)
  • Use
    controlSize(.small)
    for backward compatibility in high-density layouts (inspectors, popovers)
  • 带边框按钮默认采用胶囊形状(macOS上的迷你/小/中尺寸为保持密度仍使用圆角矩形)
  • 更圆润的外形(灵感来自硬件曲率)
  • 旋钮在交互时转换为Liquid Glass效果
  • 按钮可变形为菜单/弹出框
  • 新增超大尺寸选项用于标签和强调元素(
    controlSize(.extraLarge)
  • macOS上的控件高度略有增加(提供更多呼吸空间,更大的点击区域)
  • 在高密度布局(检查器、弹出框)中,使用
    controlSize(.small)
    实现向后兼容

Automatic Adoption

自动适配

swift
// ✅ Standard controls adopt changes automatically
Slider(value: $volume)
Toggle("Enabled", isOn: $isEnabled)
Button("Action") { }
swift
// ✅ 标准控件自动适配变化
Slider(value: $volume)
Toggle("Enabled", isOn: $isEnabled)
Button("Action") { }

If you hard-coded layout metrics

若您硬编码了布局指标

swift
// ❌ Hard-coded dimensions may break
Slider(value: $volume)
    .frame(width: 250, height: 44) // May not match new dimensions

// ✅ Use automatic sizing
Slider(value: $volume)
swift
// ❌ 硬编码的尺寸可能会失效
Slider(value: $volume)
    .frame(width: 250, height: 44) // 可能与新尺寸不匹配

// ✅ 使用自动尺寸
Slider(value: $volume)

Review Updated Controls

检查更新后的控件

Controls to Audit

需审核的控件

  • Sliders (knob transforms to glass)
  • Toggles (knob transforms to glass)
  • Buttons (morph into menus/popovers)
  • Steppers
  • Pickers
  • Segmented controls
  • Progress indicators
  • 滑块(旋钮转换为玻璃效果)
  • 开关(旋钮转换为玻璃效果)
  • 按钮(变形为菜单/弹出框)
  • 步进器
  • 选择器
  • 分段控件
  • 进度指示器

What to Check

检查要点

  • Appearance matches rest of interface
  • Spacing around controls looks natural
  • Controls not cropped by containers
  • Interaction feedback feels responsive
  • 外观与界面其他部分一致
  • 控件周围的间距自然
  • 控件未被容器裁剪
  • 交互反馈响应及时

Color in Controls

控件中的颜色

✅ DO: Use System Colors

✅ 推荐:使用系统颜色

swift
// ✅ System colors adapt to light/dark contexts
Button("Primary") { }
    .tint(.accentColor)

Toggle("Feature", isOn: $enabled)
    .tint(.blue) // System blue adapts
swift
// ✅ 系统颜色可自适应浅色/深色环境
Button("Primary") { }
    .tint(.accentColor)

Toggle("Feature", isOn: $enabled)
    .tint(.blue) // 系统蓝色会自适应

❌ DON'T: Hard-code Custom Colors

❌ 避免:硬编码自定义颜色

swift
// ❌ May not adapt to context
Button("Primary") { }
    .foregroundColor(Color(red: 0.2, green: 0.4, blue: 0.8))
swift
// ❌ 可能无法适配环境
Button("Primary") { }
    .foregroundColor(Color(red: 0.2, green: 0.4, blue: 0.8))

Legibility Guidelines

可读性指南

  • Be judicious with color in controls and navigation
  • Leverage system colors for automatic adaptation
  • Test in light and dark modes
  • Verify contrast ratios (WCAG AA minimum)
  • 控件和导航中的颜色使用要谨慎
  • 利用系统颜色实现自动适配
  • 在浅色和深色模式下测试
  • 验证对比度符合WCAG AA最低标准

Check for Crowding or Overlapping

避免控件拥挤或重叠

❌ AVOID: Crowding Controls

❌ 避免:控件过于拥挤

swift
// ❌ Controls too close together
HStack(spacing: 4) { // Too tight
    Button("Action 1") { }.glassEffect()
    Button("Action 2") { }.glassEffect()
    Button("Action 3") { }.glassEffect()
}
swift
// ❌ 控件间距过近
HStack(spacing: 4) { // 间距过窄
    Button("Action 1") { }.glassEffect()
    Button("Action 2") { }.glassEffect()
    Button("Action 3") { }.glassEffect()
}

✅ DO: Use Standard Spacing

✅ 推荐:使用标准间距

swift
// ✅ System spacing feels natural
HStack {
    Button("Action 1") { }.glassEffect()
    Button("Action 2") { }.glassEffect()
    Button("Action 3") { }.glassEffect()
}
Why Liquid Glass elements need breathing room. Overcrowding or layering glass on glass creates visual noise.
swift
// ✅ 系统间距更自然
HStack {
    Button("Action 1") { }.glassEffect()
    Button("Action 2") { }.glassEffect()
    Button("Action 3") { }.glassEffect()
}
原因 Liquid Glass元素需要足够的呼吸空间。过度拥挤或玻璃效果叠加会造成视觉噪音。

Optimize for Legibility with Scroll Edge Effects

使用滚动边缘效果优化可读性

Problem Content scrolling beneath controls can reduce legibility.
Solution
scrollEdgeEffectStyle(_:for:)
swift
// ✅ Obscure content scrolling beneath controls
ScrollView {
    LazyVStack {
        ForEach(items) { item in
            ItemRow(item)
        }
    }
}
.scrollEdgeEffectStyle(.hard, for: .top) // Maintain legibility at top edge
问题 控件下方滚动的内容可能会降低可读性。
解决方案
scrollEdgeEffectStyle(_:for:)
swift
// ✅ 模糊控件下方滚动的内容
ScrollView {
    LazyVStack {
        ForEach(items) { item in
            ItemRow(item)
        }
    }
}
.scrollEdgeEffectStyle(.hard, for: .top) // 保持顶部边缘的可读性

System bars adopt this automatically

系统栏会自动适配

  • Toolbars
  • Navigation bars
  • Tab bars
  • 工具栏
  • 导航栏
  • 标签栏

Custom bars need registration

自定义栏需要注册

swift
// Custom bar with controls/text/icons
CustomToolbar()
    .scrollEdgeEffectStyle(.hard, for: .top)
swift
// 包含控件/文本/图标的自定义栏
CustomToolbar()
    .scrollEdgeEffectStyle(.hard, for: .top)

Align Control Shapes with Containers

控件形状与容器对齐

Principle Shape of hardware informs curvature throughout interface.
原则 硬件的形状会影响整个界面的曲率。

Use
containerRelativeShape()

使用
containerRelativeShape()

swift
// ✅ Control shape aligns with container curvature
Button("Action") { }
    .containerRelativeShape(.roundedRectangle)
swift
// ✅ 控件形状与容器曲率对齐
Button("Action") { }
    .containerRelativeShape(.roundedRectangle)

Creates visual continuity

营造视觉连续性

  • Controls → concentric to sheets
  • Sheets → concentric to windows
  • Windows → concentric to display
Result Nested elements feel visually harmonious.
  • 控件 → 与弹窗同心
  • 弹窗 → 与窗口同心
  • 窗口 → 与显示屏同心
效果 嵌套元素视觉和谐统一。

New Button Styles

新按钮样式

Instead of custom Liquid Glass effects, use built-in styles

无需自定义Liquid Glass效果,使用内置样式

.borderedProminent

.borderedProminent

swift
Button("Primary Action") { }
    .buttonStyle(.borderedProminent)
    .tint(.blue)
// Filled button with Liquid Glass adaptation
swift
Button("Primary Action") { }
    .buttonStyle(.borderedProminent)
    .tint(.blue)
// 填充式按钮,适配Liquid Glass

.bordered

.bordered

swift
Button("Secondary Action") { }
    .buttonStyle(.bordered)
// Bordered button with Liquid Glass effects
swift
Button("Secondary Action") { }
    .buttonStyle(.bordered)
// 带边框按钮,带有Liquid Glass效果

.plain
with Liquid Glass

.plain
搭配Liquid Glass

swift
Button("Tertiary") { }
    .buttonStyle(.plain)
    .glassEffect()
// Custom glass application for specific needs
Best Practice Use
.borderedProminent
for primary actions,
.bordered
for secondary,
.plain
for tertiary.

swift
Button("Tertiary") { }
    .buttonStyle(.plain)
    .glassEffect()
// 针对特定需求的自定义玻璃效果应用
最佳实践 主操作使用
.borderedProminent
,次要操作使用
.bordered
, tertiary操作使用
.plain

Navigation

导航

Liquid Glass applies to topmost layer where you define navigation. Key navigation elements like tab bars and sidebars float in this Liquid Glass layer to help people focus on underlying content.
Liquid Glass应用于定义导航的最顶层。标签栏和侧边栏等关键导航元素悬浮在Liquid Glass层中,帮助用户聚焦底层内容。

Clear Navigation Hierarchy

清晰的导航层级

✅ DO: Separate Content from Navigation

✅ 推荐:分离内容与导航

┌─────────────────────────────────┐
│  Navigation Layer (Liquid Glass)│  ← Tab bar, sidebar, toolbar
│  • Clear functional layer       │
│  • Floats above content         │
├─────────────────────────────────┤
│  Content Layer (No Glass)       │  ← Articles, photos, data
│  • Underlying content           │
│  • Focus of user attention      │
└─────────────────────────────────┘
┌─────────────────────────────────┐
│  导航层(Liquid Glass)│  ← 标签栏、侧边栏、工具栏
│  • 清晰的功能层       │
│  • 悬浮在内容上方         │
├─────────────────────────────────┤
│  内容层(无玻璃效果)       │  ← 文章、照片、数据
│  • 底层内容           │
│  • 用户关注的焦点      │
└─────────────────────────────────┘

❌ DON'T: Blur the Boundary

❌ 避免:模糊内容与导航的边界

swift
// ❌ Content and navigation compete
List(items) { item in
    ItemRow(item)
        .glassEffect() // ❌ Content layer shouldn't have glass
}
Why Clear separation establishes distinct functional layers, helping users understand what's navigation vs content.
swift
// ❌ 内容与导航相互干扰
List(items) { item in
    ItemRow(item)
        .glassEffect() // ❌ 内容层不应使用玻璃效果
}
原因 清晰的分离可建立明确的功能层,帮助用户区分导航和内容。

Tab Bar Adapting to Sidebar

标签栏自适应侧边栏

Automatic Adaptation

自动适配

swift
// ✅ Tab bar adapts to sidebar depending on context
TabView {
    ContentView()
        .tabItem { Label("Home", systemImage: "house") }

    SearchView()
        .tabItem { Label("Search", systemImage: "magnifyingglass") }
}
.tabViewStyle(.sidebarAdaptable) // NEW in iOS 26
swift
// ✅ 标签栏会根据上下文自适应侧边栏
TabView {
    ContentView()
        .tabItem { Label("Home", systemImage: "house") }

    SearchView()
        .tabItem { Label("Search", systemImage: "magnifyingglass") }
}
.tabViewStyle(.sidebarAdaptable) // iOS 26新增

When it adapts

适配场景

  • iPad: Can switch to sidebar for better space usage
  • iPhone: Remains tab bar
  • macOS: Sidebar preferred
  • Adaptive window sizes: Transitions fluidly
  • iPad:可切换为侧边栏以优化空间使用
  • iPhone:保持标签栏
  • macOS:优先使用侧边栏
  • 自适应窗口尺寸:流畅过渡

Benefits

优势

  • Consistent experience across platforms
  • Better space usage on larger screens
  • Automatic with minimal code
  • 跨平台体验一致
  • 大屏设备空间利用更高效
  • 代码改动少

Split Views for Sidebar + Inspector Layouts

侧边栏+检查器布局的分栏视图

Use split views for consistent layouts

使用分栏视图实现一致布局

swift
// ✅ Split view with sidebar + content + inspector
NavigationSplitView {
    // Sidebar
    List(folders, selection: $selectedFolder) { folder in
        Label(folder.name, systemImage: folder.icon)
    }
    .navigationTitle("Folders")
} content: {
    // Main content
    List(items, selection: $selectedItem) { item in
        ItemRow(item)
    }
} detail: {
    // Inspector
    InspectorView(item: selectedItem)
}
swift
// ✅ 分栏视图处理侧边栏+内容+检查器布局
NavigationSplitView {
    // 侧边栏
    List(folders, selection: $selectedFolder) { folder in
        Label(folder.name, systemImage: folder.icon)
    }
    .navigationTitle("Folders")
} content: {
    // 主内容
    List(items, selection: $selectedItem) { item in
        ItemRow(item)
    }
} detail: {
    // 检查器
    InspectorView(item: selectedItem)
}

Platform Optimization

平台优化

  • iOS: Adaptive column visibility
  • iPadOS: All columns visible on large screens
  • macOS: Sidebar + content + inspector layout
  • Liquid Glass applied automatically to sidebars/inspectors
  • iOS:自适应列可见性
  • iPadOS:大屏设备显示所有列
  • macOS:侧边栏+内容+检查器布局
  • 侧边栏/检查器自动应用Liquid Glass

Check Content Safe Areas

检查内容安全区域

Problem Content might not peek through appropriately beneath sidebars/inspectors.
问题 内容可能无法在侧边栏/检查器下方正确显示。

Solution: Audit Safe Areas

解决方案:审核安全区域

swift
// ✅ Respect safe areas for proper content peeking
ScrollView {
    LazyVStack {
        ForEach(items) { item in
            ItemRow(item)
        }
    }
    .safeAreaInset(edge: .leading) {
        // Sidebar occupies this space
        Color.clear.frame(width: 0)
    }
}
swift
// ✅ 尊重安全区域,确保内容正确显示
ScrollView {
    LazyVStack {
        ForEach(items) { item in
            ItemRow(item)
        }
    }
    .safeAreaInset(edge: .leading) {
        // 侧边栏占据此空间
        Color.clear.frame(width: 0)
    }
}

Padding with Liquid Glass Materials

Liquid Glass材质的内边距

When implementing Liquid Glass effects that extend edge-to-edge, use
.safeAreaPadding()
instead of
.padding()
to ensure content respects device safe areas (notch, Dynamic Island, home indicator).
swift
// ❌ WRONG - Content hits notch/home indicator with Liquid Glass background
ZStack {
    // Liquid Glass background extends edge-to-edge
    RoundedRectangle(cornerRadius: 12)
        .fill(.thinMaterial)
        .ignoresSafeArea()

    VStack {
        content
    }
    .padding(.horizontal, 20)  // Doesn't account for safe areas!
}

// ✅ CORRECT - Content properly inset from safe areas + custom margin
ZStack {
    RoundedRectangle(cornerRadius: 12)
        .fill(.thinMaterial)
        .ignoresSafeArea()

    VStack {
        content
    }
    .safeAreaPadding(.horizontal, 20)  // 20pt beyond safe areas
}
Key pattern for Liquid Glass: When your material extends edge-to-edge with
.ignoresSafeArea()
, always use
.safeAreaPadding()
on the content layer to maintain proper spacing from screen edges and device-specific features.
Common Liquid Glass scenarios requiring
.safeAreaPadding()
:
  • Full-screen sheets with
    .ultraThinMaterial
    backgrounds
  • Edge-to-edge toolbars with glass effects
  • Floating panels that extend to screen edges
  • Custom navigation bars with Liquid Glass styling
Platform availability:
.safeAreaPadding()
requires iOS 17+. For iOS 16 and earlier, use
.safeAreaInset()
or manual GeometryReader calculations. See
axiom-swiftui-layout-ref
skill for complete
.safeAreaPadding()
vs
.padding()
guidance.
当实现边缘到边缘的Liquid Glass效果时,使用
.safeAreaPadding()
而非
.padding()
,确保内容避开设备安全区域(刘海、Dynamic Island、Home指示器)。
swift
// ❌ 错误 - Liquid Glass背景下内容会碰到刘海/Home指示器
ZStack {
    // Liquid Glass背景延伸至边缘
    RoundedRectangle(cornerRadius: 12)
        .fill(.thinMaterial)
        .ignoresSafeArea()

    VStack {
        content
    }
    .padding(.horizontal, 20)  // 未考虑安全区域!
}

// ✅ 正确 - 内容在安全区域外保留20pt边距
ZStack {
    RoundedRectangle(cornerRadius: 12)
        .fill(.thinMaterial)
        .ignoresSafeArea()

    VStack {
        content
    }
    .safeAreaPadding(.horizontal, 20)  // 安全区域外额外20pt边距
}
Liquid Glass核心模式 当您的材质使用
.ignoresSafeArea()
延伸至边缘时,务必在内容层使用
.safeAreaPadding()
,确保内容与屏幕边缘及设备特定元素(刘海、Dynamic Island、Home指示器)保持适当间距。
需要使用
.safeAreaPadding()
的常见Liquid Glass场景
  • 全屏弹窗,使用
    .ultraThinMaterial
    背景
  • 边缘到边缘的工具栏,带有玻璃效果
  • 延伸至屏幕边缘的浮动面板
  • 自定义导航栏,带有Liquid Glass样式
平台支持
.safeAreaPadding()
需要iOS 17+。对于iOS 16及更早版本,使用
.safeAreaInset()
或手动GeometryReader计算。完整的
.safeAreaPadding()
.padding()
对比指南,请查看
axiom-swiftui-layout-ref
技能。

What to Check

检查要点

  • Content visible beneath sidebar/inspector
  • Content not cropped inappropriately
  • Background peek-through looks intentional
  • Scrolling content visible through Liquid Glass
  • Content properly inset from notch, Dynamic Island, home indicator (use
    .safeAreaPadding()
    with edge-to-edge Liquid Glass)
  • 内容在侧边栏/检查器下方可见
  • 内容未被不当裁剪
  • 背景穿透效果符合预期
  • 滚动内容可透过Liquid Glass看到
  • 内容与刘海、Dynamic Island、Home指示器保持适当间距(边缘到边缘的Liquid Glass使用
    .safeAreaPadding()

Background Extension Effect

背景延伸效果

What It Is

功能说明

Background extension effect creates impression of stretching content under sidebar/inspector without actually scrolling it there. Mirrors adjacent content + applies blur for legibility.
背景延伸效果可营造内容延伸至侧边栏/检查器下方的视觉效果,无需实际滚动内容。系统会镜像相邻内容并应用模糊以保证可读性。

Perfect For

适用场景

  • Hero images on product pages
  • Full-bleed photo galleries
  • Edge-to-edge content experiences
  • Apps using split views
  • 产品页面的英雄图
  • 全屏照片画廊
  • 边缘到边缘的内容体验
  • 使用分栏视图的应用

How It Works

使用方法

swift
// ✅ Background extends under sidebar
NavigationSplitView {
    SidebarView()
} detail: {
    DetailView()
        .backgroundExtensionEffect()  // Mirrors and blurs content outside safe area
}
swift
// ✅ 背景延伸至侧边栏下方
NavigationSplitView {
    SidebarView()
} detail: {
    DetailView()
        .backgroundExtensionEffect()  // 镜像并模糊安全区域外的内容
}

Visual Effect

视觉效果

  1. Content appears to extend beneath sidebar
  2. Mirrored content subtly visible
  3. Blur maintains sidebar legibility
  4. Creates immersive, edge-to-edge feel
  1. 内容看起来延伸至侧边栏下方
  2. 镜像内容隐约可见
  3. 模糊效果保证侧边栏可读性
  4. 营造沉浸式的边缘到边缘体验

When to Use

使用时机

  • Split view layouts
  • Sidebar/inspector UIs
  • Media-rich content
  • Product/photo detail views
  • 分栏视图布局
  • 侧边栏/检查器界面
  • 富媒体内容
  • 产品/照片详情页

Automatically Minimize Tab Bar (iOS)

iOS标签栏自动最小化

New Behavior

新特性

Tab bars can recede when scrolling to elevate underlying content.
标签栏可在滚动时收起,突出底层内容。

How to Configure

配置方法

swift
TabView {
    ContentView()
        .tabItem { Label("Home", systemImage: "house") }
}
.tabBarMinimizeBehavior(.onScrollDown) // NEW in iOS 26
swift
TabView {
    ContentView()
        .tabItem { Label("Home", systemImage: "house") }
}
.tabBarMinimizeBehavior(.onScrollDown) // iOS 26新增

Options

选项

  • .onScrollDown
    - Minimize when scrolling down
  • .onScrollUp
    - Minimize when scrolling up
  • .automatic
    - System determines
  • .never
    - Always visible
  • .onScrollDown
    - 向下滚动时最小化
  • .onScrollUp
    - 向上滚动时最小化
  • .automatic
    - 系统自动决定
  • .never
    - 始终显示

When minimized

最小化状态

  • Tab bar recedes (smaller visual footprint)
  • Expands when scrolling in opposite direction
  • Content gains more screen space
Best Practice Use
.onScrollDown
for content-focused apps (reading, media).

  • 标签栏收起(视觉占用空间更小)
  • 反向滚动时展开
  • 内容获得更多屏幕空间
最佳实践 内容类应用(阅读、媒体)使用
.onScrollDown

Menus and Toolbars

菜单与工具栏

Menus have refreshed look across platforms. They adopt Liquid Glass, and menu items for common actions use icons to help people quickly scan and identify actions. iPadOS now has menu bar for faster access to common commands.
菜单在各平台上的外观已更新,采用Liquid Glass效果,常用操作的菜单项使用图标帮助用户快速识别。iPadOS现在支持菜单栏,方便快速访问常用命令。

Cross-Platform Menu Consistency

跨平台菜单一致性

Menus have a new design with more consistent layout across platforms. Icons are consistently on the leading edge and are now used on macOS too. The same API using
Label
or standard control initializers creates the same visual result on both iOS and macOS.
菜单采用新设计,跨平台布局更一致。图标统一显示在左侧,macOS也支持图标。使用
Label
或标准控件初始化的API,在iOS和macOS上会呈现相同的视觉效果。

Menu Icons for Standard Actions

标准操作的菜单图标

Automatic Icon Adoption

自动适配图标

swift
// ✅ Standard selectors get icons automatically
Menu("Actions") {
    Button(action: cut) {
        Text("Cut")
    }
    Button(action: copy) {
        Text("Copy")
    }
    Button(action: paste) {
        Text("Paste")
    }
}
// System uses selector to determine icon
// cut() → scissors icon
// copy() → documents icon
// paste() → clipboard icon
swift
// ✅ 标准选择器会自动获取图标
Menu("Actions") {
    Button(action: cut) {
        Text("Cut")
    }
    Button(action: copy) {
        Text("Copy")
    }
    Button(action: paste) {
        Text("Paste")
    }
}
// 系统通过选择器确定图标
// cut() → 剪刀图标
// copy() → 文档图标
// paste() → 剪贴板图标

Standard Selectors

标准选择器

  • cut()
    → ✂️ scissors
  • copy()
    → 📄 documents
  • paste()
    → 📋 clipboard
  • delete()
    → 🗑️ trash
  • share()
    → ↗️ share arrow
  • Many more...
  • cut()
    → ✂️ 剪刀
  • copy()
    → 📄 文档
  • paste()
    → 📋 剪贴板
  • delete()
    → 🗑️ 垃圾桶
  • share()
    → ↗️ 分享箭头
  • 更多...

Custom Actions

自定义操作

swift
// ✅ Provide icon for custom actions
Button {
    customAction()
} label: {
    Label("Custom Action", systemImage: "star.fill")
}
swift
// ✅ 为自定义操作提供图标
Button {
    customAction()
} label: {
    Label("Custom Action", systemImage: "star.fill")
}

Match Top Menu Actions to Swipe Actions

菜单顶部操作与滑动操作匹配

For consistency and predictability

为了一致性和可预测性

swift
// ✅ Swipe actions match contextual menu
List(emails) { email in
    EmailRow(email)
        .swipeActions(edge: .leading) {
            Button("Archive", systemImage: "archivebox") {
                archive(email)
            }
        }
        .swipeActions(edge: .trailing) {
            Button("Delete", systemImage: "trash", role: .destructive) {
                delete(email)
            }
        }
        .contextMenu {
            // ✅ Same actions appear at top
            Button("Archive", systemImage: "archivebox") {
                archive(email)
            }
            Button("Delete", systemImage: "trash", role: .destructive) {
                delete(email)
            }

            Divider()

            // Additional actions below
            Button("Mark Unread") { }
        }
}
Why Users expect swipe actions and menu actions to match. Consistency builds trust and predictability.
swift
// ✅ 滑动操作与上下文菜单匹配
List(emails) { email in
    EmailRow(email)
        .swipeActions(edge: .leading) {
            Button("Archive", systemImage: "archivebox") {
                archive(email)
            }
        }
        .swipeActions(edge: .trailing) {
            Button("Delete", systemImage: "trash", role: .destructive) {
                delete(email)
            }
        }
        .contextMenu {
            // ✅ 相同操作显示在顶部
            Button("Archive", systemImage: "archivebox") {
                archive(email)
            }
            Button("Delete", systemImage: "trash", role: .destructive) {
                delete(email)
            }

            Divider()

            // 下方为其他操作
            Button("Mark Unread") { }
        }
}
原因 用户期望滑动操作与菜单操作一致。一致性可建立信任和可预测性。

Toolbar Item Grouping

工具栏项目分组

Group items that share a background

将共享背景的项目分组

swift
// ✅ Fixed spacer separates groups
.toolbar {
    ToolbarItemGroup(placement: .topBarTrailing) {
        // Navigation group
        Button("Up") { }
        Button("Down") { }

        ToolbarSpacer(.fixed) // NEW in iOS 26 - separates groups

        // Action group
        Button("Settings") { }
    }
}
swift
// ✅ 固定间隔符分隔分组
.toolbar {
    ToolbarItemGroup(placement: .topBarTrailing) {
        // 导航组
        Button("Up") { }
        Button("Down") { }

        ToolbarSpacer(.fixed) // iOS 26新增 - 分隔分组

        // 操作组
        Button("Settings") { }
    }
}

Visual Effect

视觉效果

  • Items within group share Liquid Glass background
  • .fixed
    spacer creates visual separation
  • Clear grouping of related actions
  • 组内项目共享Liquid Glass背景
  • .fixed
    间隔符营造视觉分隔
  • 相关操作分组清晰

Best Practices

最佳实践

  • Group similar actions (navigation, formatting, settings)
  • Maintain consistent groupings across platforms
  • Use
    .fixed
    for logical separation
  • 相似操作分组(导航、格式设置、设置)
  • 跨平台保持一致的分组
  • 使用
    .fixed
    实现逻辑分隔

Monochrome Icon Rendering

单色图标渲染

Icons use monochrome rendering in more places, including toolbars. The monochrome palette reduces visual noise, emphasizes your app's content, and maintains legibility. You can still tint icons with
.tint()
, but use it to convey meaning (call to action, next step) — not just for visual effect.
图标在更多场景下使用单色渲染,包括工具栏。单色调色板可减少视觉噪音,突出应用内容,保证可读性。您仍可使用
.tint()
为图标着色,但应仅用于传达含义(操作召唤、下一步),而非单纯的视觉效果。

Removing Items from Group Background

移除项目的共享背景

Some toolbar items should appear without the shared Liquid Glass background, like standalone avatars or status indicators:
swift
.toolbar {
    ToolbarItem(placement: .topBarTrailing) {
        Image(systemName: "person.crop.circle")
            .sharedBackgroundVisibility(.hidden)
            // Item appears without glass background pill
    }
}
部分工具栏项目不应显示共享Liquid Glass背景,如独立头像或状态指示器:
swift
.toolbar {
    ToolbarItem(placement: .topBarTrailing) {
        Image(systemName: "person.crop.circle")
            .sharedBackgroundVisibility(.hidden)
            // 项目无玻璃背景胶囊
    }
}

Icons vs Text in Toolbars

工具栏中的图标与文本

✅ DO: Use Icons for Common Actions

✅ 推荐:常用操作使用图标

swift
// ✅ Icons declutter interface
.toolbar {
    ToolbarItem(placement: .topBarTrailing) {
        Button {
            share()
        } label: {
            Label("Share", systemImage: "square.and.arrow.up")
        }
    }
}
swift
// ✅ 图标简化界面
.toolbar {
    ToolbarItem(placement: .topBarTrailing) {
        Button {
            share()
        } label: {
            Label("Share", systemImage: "square.and.arrow.up")
        }
    }
}

❌ DON'T: Mix Icons and Text in Same Group

❌ 避免:同一组混合使用图标和文本

swift
// ❌ Inconsistent visual style
.toolbar {
    ToolbarItemGroup {
        Button("Save") { } // Text
        Button {
            share()
        } label: {
            Image(systemName: "square.and.arrow.up") // Icon
        }
    }
}
Guideline Pick one style (icons OR text) per background group, not both.
swift
// ❌ 视觉风格不一致
.toolbar {
    ToolbarItemGroup {
        Button("Save") { } // 文本
        Button {
            share()
        } label: {
            Image(systemName: "square.and.arrow.up") // 图标
        }
    }
}
指南 每个背景组选择一种样式(图标或文本),不要混合使用。

Backward-Compatible Toolbar Labels (iOS 18+26)

向后兼容的工具栏标签(iOS 18+26)

Liquid Glass moves toolbars from text-based to symbol-based items. For apps supporting both iOS 18 and 26, use a custom
LabelStyle
that shows text on older versions and icons on iOS 26:
swift
struct ToolbarLabelStyle: LabelStyle {
    func makeBody(configuration: Configuration) -> some View {
        if #available(iOS 26, *) {
            Label(configuration)  // Icon + text (system shows icon)
        } else {
            Label(configuration)
                .labelStyle(.titleOnly)  // Text-only on older OS
        }
    }
}

@available(iOS, introduced: 18, obsoleted: 26,
           message: "Remove — iOS 26 uses icon-based toolbars natively")
extension LabelStyle where Self == ToolbarLabelStyle {
    static var toolbar: Self { .init() }
}
Apply to toolbar buttons:
swift
ToolbarItem(placement: .confirmationAction) {
    Button("Done", systemImage: "checkmark") { }
        .labelStyle(.toolbar)
}
The
obsoleted: 26
annotation generates a compiler error when you raise your minimum target to iOS 26, reminding you to remove the compatibility shim.
Liquid Glass将工具栏从基于文本的项目改为基于符号的项目。对于同时支持iOS 18和26的应用,使用自定义
LabelStyle
,在旧版本上显示文本,在iOS 26上显示图标:
swift
struct ToolbarLabelStyle: LabelStyle {
    func makeBody(configuration: Configuration) -> some View {
        if #available(iOS 26, *) {
            Label(configuration)  // 图标+文本(系统显示图标)
        } else {
            Label(configuration)
                .labelStyle(.titleOnly)  // 旧系统仅显示文本
        }
    }
}

@available(iOS, introduced: 18, obsoleted: 26,
           message: "移除 — iOS 26原生支持基于图标的工具栏")
extension LabelStyle where Self == ToolbarLabelStyle {
    static var toolbar: Self { .init() }
}
应用于工具栏按钮:
swift
ToolbarItem(placement: .confirmationAction) {
    Button("Done", systemImage: "checkmark") { }
        .labelStyle(.toolbar)
}
obsoleted: 26
注解会在您将最低目标版本提升至iOS 26时生成编译器错误,提醒您移除兼容代码。

Floating Glass Buttons

浮动玻璃按钮

Liquid Glass replaces bottom-anchored action buttons with floating glass overlays. Use
.glassEffect(.regular.interactive())
for buttons that float above scrollable content:
swift
ZStack(alignment: .bottomTrailing) {
    List { /* content */ }

    Button(action: { }) {
        Label("Add", systemImage: "plus")
            .bold()
            .labelStyle(.iconOnly)
            .padding()
    }
    .glassEffect(.regular.interactive())
    .padding([.bottom, .trailing], 12)
}
When to use: Replace pre-iOS 26 full-width bottom buttons that break tab bar blur (non-scrollable views between list and tab bar produce solid backgrounds instead of blur).
Liquid Glass使用浮动玻璃覆盖层替代底部锚定的操作按钮。对于悬浮在可滚动内容上方的按钮,使用
.glassEffect(.regular.interactive())
swift
ZStack(alignment: .bottomTrailing) {
    List { /* 内容 */ }

    Button(action: { }) {
        Label("Add", systemImage: "plus")
            .bold()
            .labelStyle(.iconOnly)
            .padding()
    }
    .glassEffect(.regular.interactive())
    .padding([.bottom, .trailing], 12)
}
使用时机 替代iOS 26之前的全屏底部按钮,这类按钮会破坏标签栏模糊效果(列表和标签栏之间的非滚动视图会产生实心背景而非模糊效果)。

Provide Accessibility Labels for Icons

为图标提供无障碍标签

Always specify accessibility label

始终指定无障碍标签

swift
// ✅ Icon has accessibility label
Button {
    share()
} label: {
    Image(systemName: "square.and.arrow.up")
}
.accessibilityLabel("Share")
Why People using VoiceOver or Voice Control need text labels even when icons are shown visually.
swift
// ✅ 图标带有无障碍标签
Button {
    share()
} label: {
    Image(systemName: "square.and.arrow.up")
}
.accessibilityLabel("Share")
原因 使用VoiceOver或Voice Control的用户需要文本标签,即使图标在视觉上可见。

Audit Toolbar Customizations

审核工具栏自定义内容

What to Check

检查要点

  • Custom fixed spacers → verify they work with new Liquid Glass backgrounds
  • Custom items → verify appearance consistent with system behavior
  • Toolbar visibility → verify hiding/showing works correctly
  • 自定义固定间隔符 → 验证其与新Liquid Glass背景兼容
  • 自定义项目 → 验证外观与系统行为一致
  • 工具栏可见性 → 验证显示/隐藏功能正常

Common Issue: Empty Toolbar Items

常见问题:空工具栏项目

❌ Problem

❌ 问题

swift
// ❌ Hiding view instead of item
.toolbar {
    ToolbarItem {
        if showButton {
            Button("Action") { }
        } else {
            EmptyView() // ❌ Creates empty toolbar item
        }
    }
}
swift
// ❌ 隐藏视图而非项目
.toolbar {
    ToolbarItem {
        if showButton {
            Button("Action") { }
        } else {
            EmptyView() // ❌ 产生空工具栏项目
        }
    }
}

✅ Solution

✅ 解决方案

swift
// ✅ Hide entire toolbar item
.toolbar {
    if showButton {
        ToolbarItem {
            Button("Action") { }
        }
    }
}

swift
// ✅ 隐藏整个工具栏项目
.toolbar {
    if showButton {
        ToolbarItem {
            Button("Action") { }
        }
    }
}

Windows and Modals

窗口与弹窗

Windows adopt rounder corners to fit controls and navigation elements. iPadOS apps show window controls and support continuous window resizing. Sheets and action sheets adopt Liquid Glass with increased corner radius.
窗口采用更圆润的边角,适配控件和导航元素。iPadOS应用支持窗口控件和连续窗口调整大小。弹窗和操作列表采用Liquid Glass效果,边角半径增大。

Arbitrary Window Sizes (iPadOS)

任意窗口尺寸(iPadOS)

Support continuous resizing

支持连续调整大小

swift
// ✅ Content adapts to arbitrary window sizes
WindowGroup {
    ContentView()
}
.defaultSize(width: 600, height: 800)
.windowResizability(.contentSize) // NEW in iPadOS 26
swift
// ✅ 内容适配任意窗口尺寸
WindowGroup {
    ContentView()
}
.defaultSize(width: 600, height: 800)
.windowResizability(.contentSize) // iPadOS 26新增

What Changed

变化内容

  • No longer transitions between preset sizes
  • Windows resize fluidly down to minimum size
  • Content should reflow gracefully
  • 不再在预设尺寸之间切换
  • 窗口可流畅调整至最小尺寸
  • 内容应优雅重排

Developer Action

开发者操作

  • Remove hard-coded size assumptions
  • Use flexible layouts (VStack, HStack, Grid)
  • Test at various window sizes
  • 移除硬编码的尺寸假设
  • 使用灵活布局(VStack、HStack、Grid)
  • 在各种窗口尺寸下测试

Split Views for Fluid Column Resizing

流体列调整的分栏视图

Use split views for automatic reflow

使用分栏视图实现自动重排

swift
// ✅ Split view handles continuous resizing
NavigationSplitView(columnVisibility: $columnVisibility) {
    SidebarView()
} detail: {
    DetailView()
}
swift
// ✅ 分栏视图处理连续调整大小
NavigationSplitView(columnVisibility: $columnVisibility) {
    SidebarView()
} detail: {
    DetailView()
}

Benefits

优势

  • Automatic content reflow
  • Beautiful, fluid transitions
  • Minimal code
  • System-optimized animations
  • 自动内容重排
  • 流畅美观的过渡
  • 代码改动少
  • 系统优化的动画

Without split views

不使用分栏视图的情况

  • Manual layout calculations
  • Custom animation code
  • More complexity
  • 手动布局计算
  • 自定义动画代码
  • 复杂度更高

Use Layout Guides and Safe Areas

使用布局指南与安全区域

Specify safe areas for automatic adjustment

指定安全区域实现自动调整

swift
// ✅ Content respects safe areas
VStack {
    ContentView()
}
.safeAreaInset(edge: .top) {
    // Window controls and title bar
    Color.clear.frame(height: 0)
}
swift
// ✅ 内容尊重安全区域
VStack {
    ContentView()
}
.safeAreaInset(edge: .top) {
    // 窗口控件和标题栏
    Color.clear.frame(height: 0)
}

System Automatically Adjusts

系统自动调整

  • Window controls position
  • Title bar layout
  • Content layout relative to chrome
  • 窗口控件位置
  • 标题栏布局
  • 内容相对于边框的布局

Sheets: Increased Corner Radius

弹窗:增大的边角半径

What Changed

变化内容

  • Sheets have increased corner radius
  • Half sheets inset from edge (content peeks through)
  • Half sheets transitioning to full height become more opaque
  • 弹窗边角半径增大
  • 半屏弹窗与边缘之间有间隙(内容可穿透显示)
  • 半屏弹窗过渡到全屏时透明度增加

Check Content Around Edges

检查边缘周围的内容

Inside Sheet

弹窗内部

  • Content too close to rounder corners?
  • Controls cropped by corner radius?
  • 内容是否过于靠近圆润的边角?
  • 控件是否被边角半径裁剪?

Outside Sheet

弹窗外部

  • Content peeking through between inset sheet and edge looks intentional?
  • Background visible around half sheet edges?
  • 半屏弹窗与边缘之间穿透显示的内容是否符合预期?
  • 半屏弹窗边缘周围的背景是否可见?

Testing

测试

swift
// Test half sheet presentation
.sheet(isPresented: $showSheet) {
    SheetContent()
        .presentationDetents([.medium, .large])
}
swift
// 测试半屏弹窗展示
.sheet(isPresented: $showSheet) {
    SheetContent()
        .presentationDetents([.medium, .large])
}

Remove presentationBackground

移除presentationBackground

If you've used
presentationBackground
to apply a custom background to sheets, consider removing it and let the new Liquid Glass material shine:
swift
// ❌ Custom background interferes with new sheet material
.sheet(isPresented: $showDetail) {
    DetailView()
        .presentationBackground(.thinMaterial)  // Remove this
}

// ✅ System applies Liquid Glass sheet material automatically
.sheet(isPresented: $showDetail) {
    DetailView()
}
如果您曾使用
presentationBackground
为弹窗添加自定义背景,建议移除该设置,让新的Liquid Glass材质发挥效果:
swift
// ❌ 自定义背景干扰新弹窗材质
.sheet(isPresented: $showDetail) {
    DetailView()
        .presentationBackground(.thinMaterial)  // 移除此行
}

// ✅ 系统自动应用Liquid Glass弹窗材质
.sheet(isPresented: $showDetail) {
    DetailView()
}

Audit Sheet/Popover Backgrounds

审核弹窗/弹出框背景

❌ REMOVE: Custom Background Views

❌ 移除:自定义背景视图

swift
// ❌ Custom visual effect view in popover
.popover(isPresented: $showPopover) {
    ContentView()
        .background(
            VisualEffectView(effect: UIBlurEffect(style: .systemMaterial))
        ) // ❌ Interferes with Liquid Glass
}
swift
// ❌ 弹出框中的自定义视觉效果视图
.popover(isPresented: $showPopover) {
    ContentView()
        .background(
            VisualEffectView(effect: UIBlurEffect(style: .systemMaterial))
        ) // ❌ 干扰Liquid Glass
}

✅ DO: Let System Handle Background

✅ 推荐:让系统处理背景

swift
// ✅ System applies Liquid Glass automatically
.popover(isPresented: $showPopover) {
    ContentView()
    // No background modifier needed
}
swift
// ✅ 系统自动应用Liquid Glass
.popover(isPresented: $showPopover) {
    ContentView()
    // 无需背景修饰符
}

Action Sheets: Inline Appearance

操作列表:内联外观

What Changed

变化内容

Action sheets originate from the element that initiates the action (not bottom edge of display). When active, action sheets let people interact with other parts of interface.
操作列表从触发操作的元素处弹出(而非显示屏底部)。激活时,用户可与界面其他部分交互。

Specify Source of Action Sheet

指定操作列表的触发源

swift
// ✅ Action sheet anchored to source
Button("Options") {
    showActionSheet = true
}
.confirmationDialog("Options", isPresented: $showActionSheet) {
    Button("Option 1") { }
    Button("Option 2") { }
    Button("Cancel", role: .cancel) { }
}
// System positions sheet next to button automatically
swift
// ✅ 操作列表锚定至触发源
Button("Options") {
    showActionSheet = true
}
.confirmationDialog("Options", isPresented: $showActionSheet) {
    Button("Option 1") { }
    Button("Option 2") { }
    Button("Cancel", role: .cancel) { }
}
// 系统自动将弹窗定位在按钮旁边

Benefits

优势

  • Clear relationship to source
  • Doesn't block entire interface
  • More flexible interaction
  • Inline appearance feels lighter

  • 与触发源关系清晰
  • 不会遮挡整个界面
  • 交互更灵活
  • 内联外观更轻盈

Organization and Layout

组织与布局

Lists, tables, and forms have larger row height and padding to give content room to breathe. Sections have increased corner radius to match curvature of controls.
列表、表格和表单的行高和内边距增大,为内容提供更多呼吸空间。分组的边角半径增大,与控件曲率匹配。

Larger Row Height and Padding

增大的行高与内边距

What Changed

变化内容

  • Lists: Larger row height
  • Tables: More padding
  • Forms: Increased spacing
  • Sections: Increased corner radius
  • 列表:行高增大
  • 表格:内边距增加
  • 表单:间距增大
  • 分组:边角半径增大

Automatic Adoption

自动适配

swift
// ✅ Standard components adopt new metrics
List(items) { item in
    Text(item.name)
}
swift
// ✅ 标准组件自动适配新指标
List(items) { item in
    Text(item.name)
}

If you hard-coded metrics

若您硬编码了指标

swift
// ❌ May look cramped with new design
List(items) { item in
    Text(item.name)
        .frame(height: 44) // ❌ Hard-coded height
        .padding(.vertical, 4) // ❌ Hard-coded padding
}

// ✅ Use automatic sizing
List(items) { item in
    Text(item.name)
    // System determines row height and padding
}
swift
// ❌ 与新设计搭配可能显得拥挤
List(items) { item in
    Text(item.name)
        .frame(height: 44) // ❌ 硬编码高度
        .padding(.vertical, 4) // ❌ 硬编码内边距
}

// ✅ 使用自动尺寸
List(items) { item in
    Text(item.name)
    // 系统决定行高和内边距
}

Section Header Capitalization

分组标题大小写

What Changed

变化内容

Section headers no longer render entirely in capital letters. They now respect title-style capitalization you provide.
分组标题不再全部大写,现在会尊重您设置的标题式大小写。

Before (iOS 18 and earlier)

之前(iOS 18及更早版本)

swift
Section(header: Text("User settings")) {
    // Rendered as "USER SETTINGS"
}
swift
Section(header: Text("User settings")) {
    // 显示为"USER SETTINGS"
}

After (iOS 26+)

之后(iOS 26+)

swift
Section(header: Text("User Settings")) {
    // Rendered as "User Settings" (title-style)
}
swift
Section(header: Text("User Settings")) {
    // 显示为"User Settings"(标题式大小写)
}

Action Required

需要执行的操作

Update section headers to title-style capitalization:
swift
// ❌ Old style (all lowercase)
Section(header: Text("user settings")) {
    // Renders as "user settings" (looks wrong)
}

// ✅ New style (title-style)
Section(header: Text("User Settings")) {
    // Renders as "User Settings" (correct)
}
更新分组标题为标题式大小写:
swift
// ❌ 旧样式(全小写)
Section(header: Text("user settings")) {
    // 显示为"user settings"(不符合规范)
}

// ✅ 新样式(标题式大小写)
Section(header: Text("User Settings")) {
    // 显示为"User Settings"(正确)
}

Adopt Forms for Platform-Optimized Layouts

采用表单实现平台优化布局

Use
.grouped
form style

使用
.grouped
表单样式

swift
// ✅ Form adopts platform-optimized layout
Form {
    Section("Personal Information") {
        TextField("Name", text: $name)
        TextField("Email", text: $email)
    }

    Section("Preferences") {
        Toggle("Notifications", isOn: $notificationsEnabled)
        Picker("Theme", selection: $theme) {
            Text("Light").tag(Theme.light)
            Text("Dark").tag(Theme.dark)
            Text("Auto").tag(Theme.auto)
        }
    }
}
.formStyle(.grouped) // Platform-optimized metrics
swift
// ✅ 表单采用平台优化布局
Form {
    Section("Personal Information") {
        TextField("Name", text: $name)
        TextField("Email", text: $email)
    }

    Section("Preferences") {
        Toggle("Notifications", isOn: $notificationsEnabled)
        Picker("Theme", selection: $theme) {
            Text("Light").tag(Theme.light)
            Text("Dark").tag(Theme.dark)
            Text("Auto").tag(Theme.auto)
        }
    }
}
.formStyle(.grouped) // 平台优化指标

Benefits

优势

  • Automatic row height updates
  • Correct padding and spacing
  • Section corner radius matches controls
  • Consistent across platforms

  • 自动行高更新
  • 正确的内边距和间距
  • 分组边角半径与控件匹配
  • 跨平台一致

Search

搜索

Platform conventions for search location and behavior optimize experience for each device. Review search field design conventions to provide engaging search experience.
平台针对搜索位置和行为的规范优化了各设备的体验。查看搜索框设计规范,提供更优质的搜索体验。

Keyboard Layout When Activating Search

激活搜索时的键盘布局

What Changed (iOS)

变化内容(iOS)

When a person taps search field to give it focus, it slides upwards as keyboard appears.
当用户点击搜索框获取焦点时,搜索框会随键盘弹出向上滑动。

Testing

测试

  • Tap search field
  • Verify smooth upward slide
  • Keyboard appears without covering search field
  • Consistent with system search experiences (Spotlight, Safari)
  • 点击搜索框
  • 验证滑动流畅
  • 键盘弹出时不会遮挡搜索框
  • 与系统搜索体验(Spotlight、Safari)一致

No Code Changes Required

无需代码改动

swift
// ✅ Existing searchable modifier adopts new behavior
List(items) { item in
    Text(item.name)
}
.searchable(text: $searchText)
swift
// ✅ 现有searchable修饰符自动适配新行为
List(items) { item in
    Text(item.name)
}
.searchable(text: $searchText)

Semantic Search Tabs

语义化搜索标签

For Tab API patterns including
.tabRole(.search)
, see swiftui-nav-ref skill Section 5 (Tab Navigation Integration).

关于包含
.tabRole(.search)
的Tab API模式,请查看swiftui-nav-ref技能第5节(标签导航集成)。

Platform Considerations

平台注意事项

Liquid Glass can have distinct appearance and behavior across platforms, contexts, and input methods. Test across devices to understand material appearance.
Liquid Glass在不同平台、上下文和输入方式下的外观和行为可能不同。在各种设备上测试,了解材质外观。

watchOS

watchOS

Minimal Changes

变化极小

Liquid Glass changes are minimal in watchOS. They appear automatically when you open app on latest release even without building against latest SDK.
watchOS上的Liquid Glass变化极小。即使不使用最新SDK构建,在最新版本上打开应用时也会自动应用。

To Ensure Proper Adoption

确保正确适配

  • Adopt standard toolbar APIs
  • Use standard button styles from watchOS 10
swift
// ✅ Standard button styles on watchOS
Button("Action") { }
    .buttonStyle(.bordered)
  • 采用标准工具栏API
  • 使用watchOS 10的标准按钮样式
swift
// ✅ watchOS标准按钮样式
Button("Action") { }
    .buttonStyle(.bordered)

tvOS

tvOS

Focus-Based Appearance

基于焦点的外观

Standard buttons and controls take on Liquid Glass appearance when focus moves to them.
标准按钮和控件在获得焦点时会呈现Liquid Glass外观。

System Requirements

系统要求

  • Apple TV 4K (2nd generation) and newer: Full Liquid Glass effects
  • Older devices: Maintains current appearance
  • Apple TV 4K(第二代及更新机型):完整Liquid Glass效果
  • 旧设备:保持当前外观

Adopt Standard Focus APIs

采用标准焦点API

swift
// ✅ Standard focus APIs for Liquid Glass on focus
Button("Action") { }
    .focusable()
swift
// ✅ 标准焦点API实现焦点时的Liquid Glass效果
Button("Action") { }
    .focusable()

For Custom Controls

自定义控件

Apply Liquid Glass effects when they gain focus:
swift
// ✅ Custom control with focus-based glass
struct CustomControl: View {
    @FocusState private var isFocused: Bool

    var body: some View {
        Text("Custom")
            .glassEffect()
            .opacity(isFocused ? 1.0 : 0.5)
            .focused($isFocused)
    }
}
自定义控件在获得焦点时应用Liquid Glass效果:
swift
// ✅ 自定义控件,获得焦点时显示玻璃效果
struct CustomControl: View {
    @FocusState private var isFocused: Bool

    var body: some View {
        Text("Custom")
            .glassEffect()
            .opacity(isFocused ? 1.0 : 0.5)
            .focused($isFocused)
    }
}

Combining Custom Liquid Glass Effects

组合自定义Liquid Glass效果

Use
GlassEffectContainer
for Performance

使用
GlassEffectContainer
优化性能

swift
// ✅ Combine effects in container for optimization
GlassEffectContainer {
    HStack {
        Button("Action 1") { }
            .glassEffect()

        Button("Action 2") { }
            .glassEffect()

        Button("Action 3") { }
            .glassEffect()
    }
}
swift
// ✅ 在容器中组合效果以优化性能
GlassEffectContainer {
    HStack {
        Button("Action 1") { }
            .glassEffect()

        Button("Action 2") { }
            .glassEffect()

        Button("Action 3") { }
            .glassEffect()
    }
}

Benefits

优势

  • Optimizes rendering performance
  • Fluidly morphs Liquid Glass shapes into each other
  • Better animation performance
  • Reduces compositor overhead
  • 优化渲染性能
  • Liquid Glass形状之间流畅变形
  • 动画性能更好
  • 减少合成器开销

When to Use

使用时机

  • Multiple custom Liquid Glass elements
  • Morphing animations between glass shapes
  • Performance-critical interfaces
  • 多个自定义Liquid Glass元素
  • 玻璃形状之间的变形动画
  • 性能关键的界面

Performance Testing

性能测试

Profile Your App

分析应用性能

Building with latest SDKs is opportunity to assess and improve performance.
使用最新SDK构建应用是评估和提升性能的好机会。

Use Instruments

使用Instruments

  • Time Profiler (CPU usage)
  • SwiftUI (view updates - see
    axiom-swiftui-performance
    skill)
  • Allocations (memory usage)
  • Core Animation (rendering performance)
  • Time Profiler(CPU使用率)
  • SwiftUI(视图更新 - 查看
    axiom-swiftui-performance
    技能)
  • Allocations(内存使用率)
  • Core Animation(渲染性能)

What to Check

检查要点

  • Scrolling performance with Liquid Glass
  • Animation smoothness
  • Memory usage patterns
  • CPU usage during interactions
  • 带Liquid Glass的滚动性能
  • 动画流畅度
  • 内存使用模式
  • 交互时的CPU使用率

See Related Skills

查看相关技能

  • axiom-swiftui-performance
    - SwiftUI Instrument workflows
  • axiom-performance-profiling
    - Instruments decision trees
  • axiom-swiftui-performance
    - SwiftUI Instrument工作流
  • axiom-performance-profiling
    - Instruments决策树

Backward Compatibility

向后兼容

Maintain Previous Appearance

保持之前的外观

To ship with latest SDKs while keeping app as it looked when built against previous SDKs:
如需使用最新SDK构建应用,同时保持应用在旧SDK上的外观:

Add
UIDesignRequiresCompatibility
key

添加
UIDesignRequiresCompatibility

xml
<!-- Info.plist -->
<key>UIDesignRequiresCompatibility</key>
<true/>
xml
<!-- Info.plist -->
<key>UIDesignRequiresCompatibility</key>
<true/>

Effect

效果

  • App built with iOS 26 SDK
  • Appearance matches iOS 18 and earlier
  • Liquid Glass effects disabled
  • Previous blur/material styles used
  • 使用iOS 26 SDK构建应用
  • 外观与iOS 18及更早版本一致
  • Liquid Glass效果禁用
  • 使用旧版模糊/材质样式

When to Use

使用时机

  • Need time to audit interface changes
  • Gradual adoption strategy
  • Maintain exact appearance temporarily
  • 需要时间审核界面变化
  • 逐步适配策略
  • 暂时保持完全一致的外观

Migration Strategy

迁移策略

  1. Ship with
    UIDesignRequiresCompatibility
    enabled
  2. Audit interface changes in separate build
  3. Update interface incrementally
  4. Remove key when ready for Liquid Glass

  1. 启用
    UIDesignRequiresCompatibility
    发布应用
  2. 在单独构建中审核界面变化
  3. 逐步更新界面
  4. 准备好采用Liquid Glass时移除该键

Quick Reference: API Checklist

快速参考:API清单

Core Liquid Glass APIs

核心Liquid Glass API

  • glassEffect()
    - Apply Liquid Glass material
  • glassEffect(.clear)
    - Clear variant (requires 3 conditions)
  • glassEffect(in: Shape)
    - Custom shape
  • glassBackgroundEffect()
    - For custom views reflecting content
  • glassEffect()
    - 应用Liquid Glass材质
  • glassEffect(.clear)
    - 透明变体(需满足3个条件)
  • glassEffect(in: Shape)
    - 自定义形状
  • glassBackgroundEffect()
    - 用于反射内容的自定义视图

Scroll Edge Effects

滚动边缘效果

  • scrollEdgeEffectStyle(_:for:)
    - Maintain legibility where glass meets scrolling content
  • .hard
    style for pinned accessory views
  • .soft
    style for gradual fade
  • scrollEdgeEffectStyle(_:for:)
    - 玻璃效果与滚动内容交界处保持可读性
  • .hard
    样式用于固定附属视图
  • .soft
    样式用于渐隐效果

Controls and Shapes

控件与形状

  • containerRelativeShape()
    - Align control shapes with containers
  • .borderedProminent
    button style
  • .bordered
    button style
  • System colors with
    .tint()
    for adaptation
  • containerRelativeShape()
    - 控件形状与容器对齐
  • .borderedProminent
    按钮样式
  • .bordered
    按钮样式
  • 使用系统颜色搭配
    .tint()
    实现自适应

Navigation

导航

  • .tabViewStyle(.sidebarAdaptable)
    - Tab bar adapts to sidebar
  • .tabBarMinimizeBehavior(_:)
    - Minimize on scroll
  • .tabRole(.search)
    - Semantic search tabs
  • NavigationSplitView
    for sidebar + inspector layouts
  • .tabViewStyle(.sidebarAdaptable)
    - 标签栏自适应侧边栏
  • .tabBarMinimizeBehavior(_:)
    - 滚动时最小化
  • .tabRole(.search)
    - 语义化搜索标签
  • NavigationSplitView
    用于侧边栏+检查器布局

Toolbars and Menus

工具栏与菜单

  • ToolbarSpacer(.fixed)
    - Separate toolbar groups
  • Standard selectors for automatic menu icons
  • Match contextual menu actions to swipe actions
  • ToolbarSpacer(.fixed)
    - 分隔工具栏分组
  • 标准选择器实现自动菜单图标
  • 上下文菜单操作与滑动操作匹配

Organization and Layout

组织与布局

  • .formStyle(.grouped)
    - Platform-optimized form layouts
  • Title-style capitalization for section headers
  • Respect automatic row height and padding
  • .formStyle(.grouped)
    - 平台优化的表单布局
  • 分组标题使用标题式大小写
  • 尊重自动行高和内边距

Performance

性能

  • GlassEffectContainer
    - Combine multiple glass effects
  • Profile with Instruments
  • Test with accessibility settings
  • GlassEffectContainer
    - 组合多个玻璃效果
  • 使用Instruments分析
  • 结合无障碍设置测试

Backward Compatibility

向后兼容

  • UIDesignRequiresCompatibility
    in Info.plist (if needed)

  • Info.plist中的
    UIDesignRequiresCompatibility
    (如有需要)

Audit Checklist

审核清单

Use this checklist when auditing app for Liquid Glass adoption:
审核应用Liquid Glass适配情况时使用本清单:

Visual Refresh

视觉更新

  • Built with Xcode 26 SDK
  • Run on latest platform releases
  • Standard components adopt Liquid Glass automatically
  • Custom backgrounds in controls/navigation removed
  • Tested with Reduce Transparency
  • Tested with Increase Contrast
  • Tested with Reduce Motion
  • Liquid Glass not overused on custom controls
  • 使用Xcode 26 SDK构建
  • 在最新平台版本上运行
  • 标准组件自动适配Liquid Glass
  • 移除控件/导航中的自定义背景
  • 结合降低透明度测试
  • 结合增加对比度测试
  • 结合减少动态效果测试
  • 自定义控件未过度使用Liquid Glass

App Icons

应用图标

  • Designed with foreground/middle/background layers
  • Exported layers from design app
  • Composed in Icon Composer
  • Previewed against updated grids
  • All appearance variants tested (light/dark/clear/tinted)
  • Elements centered to avoid clipping
  • 采用前景/中间层/背景层的分层设计
  • 从设计工具导出图层
  • 使用Icon Composer组合
  • 对照更新后的网格预览
  • 测试所有外观变体(浅色/深色/透明/着色)
  • 元素居中避免裁剪

Controls

控件

  • Updated appearance reviewed (capsule default for bordered buttons)
  • Hard-coded layout metrics removed (control heights changed)
  • controlSize(.small)
    for backward-compatible high-density layouts
  • System colors used for adaptation
  • Controls not crowded or overlapping
  • Scroll edge effects applied where needed
  • Control shapes aligned with containers (
    .containerConcentric
    if desired)
  • New button styles adopted (
    .borderedProminent
    ,
    .bordered
    )
  • Extra large buttons used for prominent actions where appropriate
  • 审核更新后的外观(带边框按钮默认采用胶囊形状)
  • 移除硬编码的布局指标(控件高度已变化)
  • 高密度布局使用
    controlSize(.small)
    实现向后兼容
  • 使用系统颜色实现自适应
  • 控件未拥挤或重叠
  • 必要时应用滚动边缘效果
  • 控件形状与容器对齐(如需可使用
    .containerConcentric
  • 采用新按钮样式(
    .borderedProminent
    .bordered
  • 重要操作酌情使用超大按钮

Navigation

导航

  • Clear hierarchy (navigation layer vs content layer)
  • Tab bar adapts to sidebar (if appropriate)
  • Split views used for sidebar + inspector layouts
  • Content safe areas checked
  • Background extension effect considered
  • Tab bar minimization configured (if desired)
  • 层级清晰(导航层与内容层分离)
  • 标签栏自适应侧边栏(如适用)
  • 分栏视图用于侧边栏+检查器布局
  • 检查内容安全区域
  • 考虑使用背景延伸效果
  • 配置标签栏最小化(如需)

Menus and Toolbars

菜单与工具栏

  • Standard selectors used for automatic menu icons
  • Top menu actions match swipe actions
  • Toolbar items grouped logically with
    ToolbarSpacer(.fixed)
  • Icons OR text used per group (not mixed)
  • Monochrome icon rendering embraced (tint only for meaning)
  • sharedBackgroundVisibility(.hidden)
    for standalone items (avatars, status)
  • Accessibility labels provided for all icons
  • Custom toolbar items audited for compatibility
  • 标准选择器用于自动菜单图标
  • 菜单顶部操作与滑动操作匹配
  • 使用
    ToolbarSpacer(.fixed)
    合理分组工具栏项目
  • 每组使用图标或文本(不混合)
  • 采用单色图标渲染(仅为传达含义着色)
  • 独立项目使用
    sharedBackgroundVisibility(.hidden)
  • 所有图标提供无障碍标签
  • 审核自定义工具栏项目兼容性

Windows and Modals

窗口与弹窗

  • Arbitrary window sizes supported (iPadOS)
  • Split views used for fluid column resizing
  • Layout guides and safe areas specified
  • Sheet content checked around rounder corners
  • Content peeking through half sheets reviewed
  • presentationBackground
    removed from sheets (let Liquid Glass material shine)
  • Custom sheet/popover backgrounds removed
  • Action sheets specify source element
  • 支持任意窗口尺寸(iPadOS)
  • 分栏视图用于流体列调整
  • 指定布局指南和安全区域
  • 检查弹窗边角周围的内容
  • 审核半屏弹窗的内容穿透效果
  • 移除弹窗的
    presentationBackground
    (让Liquid Glass材质发挥效果)
  • 移除自定义弹窗/弹出框背景
  • 操作列表指定触发源元素

Organization and Layout

组织与布局

  • Hard-coded row heights removed
  • Section headers use title-style capitalization
  • .formStyle(.grouped)
    adopted for forms
  • Automatic row height and padding respected
  • 移除硬编码的行高
  • 分组标题使用标题式大小写
  • 表单采用
    .formStyle(.grouped)
  • 尊重自动行高和内边距

Search

搜索

  • Keyboard layout tested when activating search
  • .tabRole(.search)
    used for search tabs (if tab-based)
  • Search placement appropriate for platform
  • 测试激活搜索时的键盘布局
  • 搜索标签使用
    .tabRole(.search)
    (如为标签式布局)
  • 搜索位置符合平台规范

Platform Considerations

平台注意事项

  • watchOS: Standard toolbar APIs and button styles adopted
  • tvOS: Standard focus APIs adopted for custom controls
  • GlassEffectContainer
    used for combining custom effects
  • Performance tested with Instruments
  • UIDesignRequiresCompatibility
    key considered (if backward compatibility needed)

  • watchOS:采用标准工具栏API和按钮样式
  • tvOS:自定义控件采用标准焦点API
  • 多个自定义玻璃效果使用
    GlassEffectContainer
  • 使用Instruments测试性能
  • 考虑使用
    UIDesignRequiresCompatibility
    键(如需向后兼容)

Resources

资源

WWDC: 2025-219, 2025-323 (Build a SwiftUI app with the new design)
Docs: /TechnologyOverviews/liquid-glass, /TechnologyOverviews/adopting-liquid-glass, /design/Human-Interface-Guidelines/materials
Sample Code: /SwiftUI/Landmarks-Building-an-app-with-Liquid-Glass
Skills: axiom-liquid-glass, axiom-swiftui-performance, axiom-swiftui-debugging, axiom-accessibility-diag

Last Updated: 2025-12-01 Minimum Platform: iOS 26, iPadOS 26, macOS Tahoe, tvOS, watchOS, axiom-visionOS 3 Xcode Version: Xcode 26+ Skill Type: Reference (comprehensive adoption guide)
WWDC:2025-219、2025-323(使用新设计构建SwiftUI应用)
文档:/TechnologyOverviews/liquid-glass、/TechnologyOverviews/adopting-liquid-glass、/design/Human-Interface-Guidelines/materials
示例代码:/SwiftUI/Landmarks-Building-an-app-with-Liquid-Glass
技能:axiom-liquid-glass、axiom-swiftui-performance、axiom-swiftui-debugging、axiom-accessibility-diag

最后更新:2025-12-01 最低平台版本:iOS 26、iPadOS 26、macOS Tahoe、tvOS、watchOS、axiom-visionOS 3 Xcode版本:Xcode 26+ 技能类型:参考(综合适配指南)