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
This commit is contained in:
parent
26a7335d4d
commit
eb2cd077a9
|
@ -58,13 +58,17 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder)
|
|||
|
||||
- (void)insertReactSubview:(UIView *)subview atIndex:(__unused NSInteger)atIndex
|
||||
{
|
||||
RCTAssert([_modalViewController.view reactTag] == nil, @"Modal view can only have one subview");
|
||||
[subview addGestureRecognizer:_touchHandler];
|
||||
subview.autoresizingMask = UIViewAutoresizingFlexibleHeight |
|
||||
UIViewAutoresizingFlexibleWidth;
|
||||
_modalViewController.view = subview;
|
||||
}
|
||||
|
||||
- (void)removeReactSubview:(UIView *)subview
|
||||
{
|
||||
RCTAssert(subview == _modalViewController.view, @"Cannot remove view other than modal view");
|
||||
[subview removeGestureRecognizer:_touchHandler];
|
||||
_modalViewController.view = nil;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue