當我使用 .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).