Skip to content

Commit

Permalink
Revert container frame update change from #354 (#379)
Browse files Browse the repository at this point in the history
Reverting that change as it turned out not to be necessary. At the moment of attaching screen we already have the frame set on the child VC. Updating it there again was cauinsg some visual glitches with old react-navigation screen container based implementation.
  • Loading branch information
kmagiera committed Feb 24, 2020
1 parent e38c5bf commit 0dd03e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ios/RNSScreenContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ - (void)insertReactSubview:(RNSScreenView *)subview atIndex:(NSInteger)atIndex
{
subview.reactSuperview = self;
[_reactSubviews insertObject:subview atIndex:atIndex];
subview.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
}

- (void)removeReactSubview:(RNSScreenView *)subview
Expand Down Expand Up @@ -83,7 +84,9 @@ - (void)detachScreen:(RNSScreenView *)screen
- (void)attachScreen:(RNSScreenView *)screen
{
[_controller addChildViewController:screen.controller];
screen.controller.view.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
// the frame is already set at this moment because we adjust it in insertReactSubview. We don't
// want to update it here as react-driven animations may already run and hence changing the frame
// would result in visual glitches
[_controller.view addSubview:screen.controller.view];
[screen.controller didMoveToParentViewController:_controller];
[_activeScreens addObject:screen];
Expand Down

0 comments on commit 0dd03e2

Please sign in to comment.