You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
frameOfPresentedViewInContainerView is unfortunately only called during the initial presentation of a view controller, meaning a view controller that's presented over part of the screen won't know to update its layout when the device's orientation changes.
To solve this, we can implement viewWillTransitionToSize and invoke _calculateFrameOfPresentedView with the new dimensions. This will allow the block to return a new size for the new dimensions.
Unfortunately, some quick sleuthing revealed that the containerView's frame isn't up-to-date when viewWillTransitionToSize is invoked and, because our block implementations tend to look at the containerView's bounds, most of our layout blocks will probably be wrong.
The text was updated successfully, but these errors were encountered:
I believe you want to query the frame as you animateAlongsideTransition inside your PresentationController.
-(void)viewWillTransitionToSize:withTransitionCoordinator: {
// Call super ...
[coordinator animateAlongsideTransition: ^() {
// self.contentView.frame should be current now
self.presentedView.frame = [self frameOfPresentedViewInContainerView];
}
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
frameOfPresentedViewInContainerView
is unfortunately only called during the initial presentation of a view controller, meaning a view controller that's presented over part of the screen won't know to update its layout when the device's orientation changes.To solve this, we can implement viewWillTransitionToSize and invoke
_calculateFrameOfPresentedView
with the new dimensions. This will allow the block to return a new size for the new dimensions.Unfortunately, some quick sleuthing revealed that the
containerView
's frame isn't up-to-date whenviewWillTransitionToSize
is invoked and, because our block implementations tend to look at the containerView's bounds, most of our layout blocks will probably be wrong.The text was updated successfully, but these errors were encountered: