johnpatrickmorgan / FlowStacks

FlowStacks allows you to hoist SwiftUI navigation and presentation state into a Coordinator
MIT License
783 stars 56 forks source link

Not able to achieve Translucent background for fullScreenCover or sheet #58

Closed Ajay-Jar closed 11 months ago

Ajay-Jar commented 11 months ago

In the below video I am getting grey background color when presenting screen2 but I am expecting translucent color. Please Help me You can find my code below.

TranslucentBackground.zip

https://github.com/johnpatrickmorgan/FlowStacks/assets/137762311/2d2d794f-18cd-4811-b962-52540bb432da

johnpatrickmorgan commented 11 months ago

HI @Ajay-Jar, thanks for raising this issue. This behaviour is defined by SwiftUI not FlowStacks - you'll see the same behaviour using vanilla navigation.

However, I can point you to a new api in iOS 16. The new presentationDetents modifier that can be used to achieve this effect, e.g. by adding .presentationDetents([.medium]) to Screen2.