當我使用 .formSheet mode present 一個 sheet 的時候,我該如何根據內容自動調整 sheet 高度
Asked on 09/25/2024
1 search
To automatically adjust the height of a sheet presented in .formSheet
mode based on its content, you can use SwiftUI's presentation sizing capabilities. In the session titled "What’s new in SwiftUI," it is mentioned that presentation sizing is now unified and simplified across platforms. You can use the presentationSizing
modifier to create perfectly sized sheets with form or page, or even use custom sizing.
For more details, you can refer to the session What’s new in SwiftUI (02:22).

Dive deep into volumes and immersive spaces
Discover powerful new ways to customize volumes and immersive spaces in visionOS. Learn to fine-tune how volumes resize and respond to people moving around them. Make volumes and immersive spaces interact through the power of coordinate conversions. Find out how to make your app react when people adjust immersion with the Digital Crown, and use a surrounding effect to dynamically customize the passthrough tint in your immersive space experience.

What’s new in AppKit
Discover the latest advances in Mac app development. Get an overview of the new features in macOS Sequoia, and how to adopt them in your app. Explore new ways to integrate your existing code with SwiftUI. Learn about the improvements made to numerous AppKit controls, like toolbars, menus, text input, and more.

What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.