Browse Source

Prevent navBar header background transition in modals, fixes black background in modals navBar

yogevbd 6 years ago
parent
commit
335dd424a2
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      ios/RCCViewController.m

+ 12
- 1
ios/RCCViewController.m View File

@@ -535,7 +535,7 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
535 535
         }
536 536
     };
537 537
     
538
-    if (!self.transitionCoordinator || self.transitionCoordinator.initiallyInteractive || !navBarTransparentBool || appeared) {
538
+    if (!self.transitionCoordinator || self.transitionCoordinator.initiallyInteractive || !navBarTransparentBool || appeared || [self isModal]) {
539 539
         action();
540 540
     } else {
541 541
         UIView* backgroundView = [self.navigationController.navigationBar valueForKey:@"backgroundView"];
@@ -641,6 +641,17 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
641 641
 #endif
642 642
 }
643 643
 
644
+- (BOOL)isModal {
645
+    if([self presentingViewController])
646
+        return YES;
647
+    if([[[self navigationController] presentingViewController] presentedViewController] == [self navigationController])
648
+        return YES;
649
+    if([[[self tabBarController] presentingViewController] isKindOfClass:[UITabBarController class]])
650
+        return YES;
651
+    
652
+    return NO;
653
+}
654
+
644 655
 -(void)processTitleView:(UIViewController*)viewController
645 656
                   props:(NSDictionary*)props
646 657
                   style:(NSDictionary*)style {