Closed PhilipDukhov closed 11 months ago
You're missing making the content flexible. So the background
modifier never proposes a view frame that would overlap with the safe area.
Add .frame(maxWidth: .infinity, maxHeight: .infinity)
before the background modifier.
Or even better, use the preferredPresentationBackgroundColor
option for the presentation transition and the color will be applied to the background of the presented UIViewController
, guaranteeing it spans the entire background without needing to fuss with SwiftUI layout
options: .init(preferredPresentationBackgroundColor: .red)
I need to fill background, including safe area - I'm doing it manually because we use material in real world, so it cannot be passed with options.
This bug reproduces only with some strict layout conditions - removing title,
spacing
orminHeight
"solves" the problem