I am presenting a UIViewController
using a custom transition and a custom UIPresentationController
. The view controller's view does not cover the entire screen, so the presenting view controller is still visible.
Next, I present an instance of UIImagePickerController
on top of this view controller. The problem is that when I dismiss the image picker, the presenting view controller's frame covers the entire screen instead of just the portion I want it to cover. The frame specified by frameOfPresentedViewInContainerView
in my custom UIPresentationController
seems to be completely ignored.
Only if present the image picker with a modalPresentationStyle
of UIModalPresentationOverCurrentContext
my frames remain intact (which makes sense since no views are removed from the view hierarchy in the first place). Unfortunately that's not what I want. I want the image picker to be presented full screen, which - for whatever reason - seems to mess up my layout. Anything that I might be doing wrong or forgetting here? Any suggestions?
I tried both wrapper approaches mentioned. One side effect of using this wrapping approach is that device rotation doesn't display well - introducing black boxes around the presented view.
Instead of doing the wrapping trick, try setting the modalPresentationStyle
of the presented UIImagePickerController
to UIModalPresentationOverFullScreen
. This means the views underneath the image picker won't be removed/restored from the view hierarchy during presentation/dismissal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With