Browse Source

fixes tabBar layout after dismissing a modal in iphone x

yogevbd 6 years ago
parent
commit
5e66068f8a
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      ios/RCCManagerModule.m

+ 8
- 1
ios/RCCManagerModule.m View File

@@ -380,7 +380,14 @@ RCT_EXPORT_METHOD(dismissController:(NSString*)animationType resolver:(RCTPromis
380 380
         [[RCCManager sharedIntance] unregisterController:vc];
381 381
         
382 382
         [vc dismissViewControllerAnimated:![animationType isEqualToString:@"none"]
383
-                               completion:^(){ resolve(nil); }];
383
+                               completion:^(){ 
384
+                                   // This fixes weird ios tabBar layout bug after presenting a modal on top of UITabBarController
385
+                                   UIViewController* rootVC = [UIApplication sharedApplication].delegate.window.rootViewController;
386
+                                   if ([rootVC isKindOfClass:[UITabBarController class]]) {
387
+                                       [rootVC.view setNeedsLayout];
388
+                                   }
389
+                                   resolve(nil);
390
+                                    }];
384 391
     } else {
385 392
         resolve(nil);
386 393
     }