applidium / OverlayContainer

Non-intrusive iOS UI library to implement overlay based interfaces
https://gaetanzanella.github.io/2018-12-17/replicating-apple-maps-overlay
Other
1.15k stars 94 forks source link

Incorrect height for navigation bar when presenting modally #74

Closed wrightak closed 2 years ago

wrightak commented 4 years ago

Make the changes shown here: https://github.com/wrightak/OverlayContainer/commit/9e50c5b4527be54a79a4a6bfecfb03ffe79e53be

Then run the OverlayContainer_Example, which should already be showing the ActivityControllerPresentationLikeViewController. When presenting, the navigation bar height is incorrect. I think something might be happening with safe area insets. When you swipe to different notches, the height corrects itself and stays corrected. This only happens on the lowest notch, presenting the medium notch shows no problem.

Before swiping:

Simulator Screen Shot - iPhone SE (2nd generation) - 2020-10-04 at 13 34 53

After swiping (correct height):

Simulator Screen Shot - iPhone SE (2nd generation) - 2020-10-04 at 13 35 04

gaetanzanella commented 4 years ago

Hi @wrightak, thanks for the detailed issue. It comes from the native safe area inset update behaviour described here. Can you use the .flexibleHeight overlay container style?

wrightak commented 4 years ago

Thanks for the kind reply. I read the section of the readme that you linked to, and found the video, but I'm still not 100% understanding what's going on. I guess I need to read more. I especially don't understand why swiping up and down changes the safe area insets. And why those insets can't be corrected before swiping.

Using .flexibleHeight worked for me, thank you.