diff --git a/Objective-C/TOCropViewController/TOCropViewController.m b/Objective-C/TOCropViewController/TOCropViewController.m index ff399e99..aef0c5da 100644 --- a/Objective-C/TOCropViewController/TOCropViewController.m +++ b/Objective-C/TOCropViewController/TOCropViewController.m @@ -489,6 +489,12 @@ - (void)viewSafeAreaInsetsDidChange { - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; + [UIView performWithoutAnimation:^{ + self.toolbar.frame = [self frameForToolbarWithVerticalLayout:self.verticalLayout]; + [self adjustToolbarInsets]; + [self.toolbar setNeedsLayout]; + }]; + self.cropView.frame = [self frameForCropViewWithVerticalLayout:self.verticalLayout]; [self adjustCropViewInsets]; [self.cropView moveCroppedContentToCenterAnimated:NO]; @@ -502,12 +508,6 @@ - (void)viewDidLayoutSubviews { self.titleLabel.frame = [self frameForTitleLabelWithSize:self.titleLabel.frame.size verticalLayout:self.verticalLayout]; [self.cropView moveCroppedContentToCenterAnimated:NO]; } - - [UIView performWithoutAnimation:^{ - self.toolbar.frame = [self frameForToolbarWithVerticalLayout:self.verticalLayout]; - [self adjustToolbarInsets]; - [self.toolbar setNeedsLayout]; - }]; } #pragma mark - Rotation Handling - diff --git a/Objective-C/TOCropViewController/Views/TOCropView.m b/Objective-C/TOCropViewController/Views/TOCropView.m index 919769e0..7e12ca63 100644 --- a/Objective-C/TOCropViewController/Views/TOCropView.m +++ b/Objective-C/TOCropViewController/Views/TOCropView.m @@ -1709,8 +1709,8 @@ - (CGRect)contentBounds { CGRect contentRect = CGRectZero; contentRect.origin.x = self.cropViewPadding + self.cropRegionInsets.left; contentRect.origin.y = self.cropViewPadding + self.cropRegionInsets.top; - contentRect.size.width = CGRectGetWidth(self.bounds) - ((self.cropViewPadding * 2) + self.cropRegionInsets.left + self.cropRegionInsets.right); - contentRect.size.height = CGRectGetHeight(self.bounds) - ((self.cropViewPadding * 2) + self.cropRegionInsets.top + self.cropRegionInsets.bottom); + contentRect.size.width = CGRectGetWidth(self.frame) - ((self.cropViewPadding * 2) + self.cropRegionInsets.left + self.cropRegionInsets.right); + contentRect.size.height = CGRectGetHeight(self.frame) - ((self.cropViewPadding * 2) + self.cropRegionInsets.top + self.cropRegionInsets.bottom); return contentRect; }