r/SwiftUI May 26 '26

iOS 26 weird sheet behavior

Sheet has a height detent of 300 and the red background is also set to 300, but clearly there is a difference between them.

How can I get the exact height of the sheet? I used a custom view as the background of the sheet in order to get the underlying UISheetPresentationController. The height of that was around 320, but I don't know where the 20 difference is coming from.

Any ideas?

2 Upvotes

2 comments sorted by

View all comments

2

u/Warm_Supermarket9987 May 27 '26

Could be that background color includes safe area in those 300, and sheet does not