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:
Pieter De Baets 2016-02-22 04:43:51 -08:00 committed by facebook-github-bot-7
parent 26a7335d4d
commit eb2cd077a9
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}