在 visionOS 使用 Widget 的官方示例代码是哪个?
Asked on 2025-06-14
3 searches
在 WWDC 2025 的 "Design widgets for visionOS" 会议中,提到了 visionOS 上的 Widget 设计示例。特别是天气 Widget 被用作示例,展示了如何在 visionOS 上适应大窗口格式,并优先显示当前条件的清晰描述。这个设计旨在创造一种看窗外的错觉,确保在墙上安装时的可读性。你可以在 Design widgets for visionOS (05:17) 中找到相关的内容。
如果你需要官方的示例代码,通常可以在 Apple 的开发者网站或相关的开发者文档中找到。

Design widgets for visionOS
Learn how you can design beautiful widgets for visionOS 26 that blend effortlessly into someone’s surroundings. Discover how you can add depth to your widget design and customize materials, sizes, and styles for spatial computing. We’ll share how to adapt your existing widgets for visionOS, or design new widgets that feel like real objects.

What’s new in widgets
WidgetKit elevates your app with updates to widgets, Live Activities, and controls. Learn how to bring your widgets to visionOS, take them on the road with CarPlay, and make them look their best with accented rendering modes. Plus, find out how relevant widgets can be surfaced in the Smart Stack on watchOS, and discover how push notifications can be used to keep your widgets up to date.

What’s new in visionOS 26
Explore exciting new features in visionOS 26. Discover enhanced volumetric APIs and learn how you can combine the power of SwiftUI, RealityKit and ARKit. Find out how you can build more engaging apps and games using faster hand tracking and input from spatial accessories. Get a sneak peek at updates to SharePlay, Compositor Services, immersive media, spatial web, Enterprise APIs, and much more.