Post

Replies

Boosts

Views

Activity

How to change the background behind a presented view
I am presenting a sheet in my project but I would like to change the opacity/color of the background behind the view presented. Here's my code : @State var presentElement: Bool = false var body: some View { Text("Present el") .onTapGesture { presentElement = true } .sheet(isPresented: $presentElement) { NotifActionModal() .background() { GeometryReader { geometry in Path { path in frameSize = geometry.size.height } } } .presentationDetents([.height(frameSize)]) } }
3
0
3.5k
Sep ’23