Skip to content

Commit

Permalink
fix: RNSScreen viewDidLayoutSubviews
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed May 13, 2022
1 parent fab1be7 commit bf1a835
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -782,13 +782,14 @@ - (void)viewDidLayoutSubviews
[self.parentViewController isKindOfClass:[RNScreensNavigationController class]];
BOOL isPresentedAsNativeModal = self.parentViewController == nil && self.presentingViewController != nil;

if ((isDisplayedWithinUINavController || isPresentedAsNativeModal) &&
!CGRectEqualToRect(_lastViewFrame, self.view.frame)) {
_lastViewFrame = self.view.frame;
if (isDisplayedWithinUINavController || isPresentedAsNativeModal) {
#ifdef RN_FABRIC_ENABLED
[_initialView updateBounds];
#else
[((RNSScreenView *)self.viewIfLoaded) updateBounds];
if (!CGRectEqualToRect(_lastViewFrame, self.view.frame)) {
_lastViewFrame = self.view.frame;
[((RNSScreenView *)self.viewIfLoaded) updateBounds];
}
#endif
}
}
Expand Down

0 comments on commit bf1a835

Please sign in to comment.