Skip to content

Commit eb2cd07

Browse files
javachefacebook-github-bot-7
authored andcommitted
Support rotation in RCTModalHostView
Summary: When rotating a modal view we should adjust the root view's frame. Reviewed By: majak Differential Revision: D2939712 fb-gh-sync-id: 974634276d2c0ad22b46976020d0a21e1dac9026 shipit-source-id: 974634276d2c0ad22b46976020d0a21e1dac9026
1 parent 26a7335 commit eb2cd07

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎React/Views/RCTModalHostView.m‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ - (void)notifyForBoundsChange:(CGRect)newBounds
5858

5959
- (void)insertReactSubview:(UIView *)subview atIndex:(__unused NSInteger)atIndex
6060
{
61+
RCTAssert([_modalViewController.view reactTag] == nil, @"Modal view can only have one subview");
6162
[subview addGestureRecognizer:_touchHandler];
63+
subview.autoresizingMask = UIViewAutoresizingFlexibleHeight |
64+
UIViewAutoresizingFlexibleWidth;
6265
_modalViewController.view = subview;
6366
}
6467

6568
- (void)removeReactSubview:(UIView *)subview
6669
{
6770
RCTAssert(subview == _modalViewController.view, @"Cannot remove view other than modal view");
71+
[subview removeGestureRecognizer:_touchHandler];
6872
_modalViewController.view = nil;
6973
}
7074

0 commit comments

Comments
 (0)