From 0ce2bbdd644dab688c052d5bd2391e563c5fd98d Mon Sep 17 00:00:00 2001 From: Mehdi Mulani Date: Mon, 26 Sep 2016 15:49:10 -0700 Subject: [PATCH] Fix Modal to handle in-call status bar Summary: Changing the Modal's presentation style ensures that UIKit correctly adjusts its bounds when entering/exiting the in-call status bar. Reviewed By: fkgozali Differential Revision: D3916167 fbshipit-source-id: a0bea60751744ac082ba6ec38177fb093a8f2be5 --- React/Views/RCTModalHostView.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/React/Views/RCTModalHostView.m b/React/Views/RCTModalHostView.m index f82726bd3..a7bd40099 100644 --- a/React/Views/RCTModalHostView.m +++ b/React/Views/RCTModalHostView.m @@ -37,7 +37,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder) _bridge = bridge; _modalViewController = [RCTModalHostViewController new]; UIView *containerView = [UIView new]; - containerView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + containerView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; _modalViewController.view = containerView; _touchHandler = [[RCTTouchHandler alloc] initWithBridge:bridge]; _isPresented = NO; @@ -148,7 +148,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder) - (BOOL)isTransparent { - return _modalViewController.modalPresentationStyle == UIModalPresentationCustom; + return _modalViewController.modalPresentationStyle == UIModalPresentationOverFullScreen; } - (BOOL)hasAnimationType @@ -158,7 +158,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder) - (void)setTransparent:(BOOL)transparent { - _modalViewController.modalPresentationStyle = transparent ? UIModalPresentationCustom : UIModalPresentationFullScreen; + _modalViewController.modalPresentationStyle = transparent ? UIModalPresentationOverFullScreen : UIModalPresentationFullScreen; } - (UIInterfaceOrientationMask)supportedOrientationsMask