I’m trying to open a sheet, but when I’m opening it, the screen underneath is bouncing a little bit. I noticed that is because of pressentationDetents
and self.detentHeight
. If I’m giving it a static value like 300, is the screen underneath is not bouncing at all. I tested it on iOS 16.0 and on iOS 17.5, and only on iOS 17.5 is bouncing. What should be the issue ? Thanks.
.sheet(isPresented: $viewModel.showLocationSheet) {
LocationsListView()
.presentationDragIndicator(.visible)
.readHeight()
.onPreferenceChange(HeightPreferenceKey.self) { height in
if let height {
self.detentHeight = height
}
}
.presentationDetents([.height(self.detentHeight)])
}
I tried removing the presentationDetents
and modifying the detentHeight
with a static value and is working.
Maria Alexandra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.