visionOS26 中如何把 window 用 anchor 吸附到墙上?
Asked on 06/20/2025
1 search
在visionOS 26中,可以通过将窗口靠近物理环境的表面来将其吸附到墙上。这种功能被称为“表面吸附”功能。用户可以将窗口的背面吸附到垂直表面(如墙壁)上,从而将其固定在该位置。对于持久性,用户可以将窗口的底部吸附到水平表面(如地板或桌子)上。有关详细信息,可以参考Set the scene with SwiftUI in visionOS (08:02) 这一部分。

Set the scene with SwiftUI in visionOS
Discover exciting new APIs to enhance windows, volumes, and immersive spaces in your visionOS app. Fine tune the behavior of your scenes when relaunched or locked in place. Make volumes adapt to their surroundings with clipping margins and snapping. Stream immersive content from Mac to Vision Pro. Elevate your existing UIKit-based apps with volumes and immersive spaces.

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.

Explore enhancements to your spatial business app
Discover how the latest enhancements and APIs in visionOS 26 expand access and extend enterprise capabilities announced last year. Learn how these all-new features make it easy to build model training workflows, enhance video feeds, and enable you to align coordinate systems over a local network to develop collaborative experiences in your in-house app.