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
         }
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
         action();
539
         action();
540
     } else {
540
     } else {
541
         UIView* backgroundView = [self.navigationController.navigationBar valueForKey:@"backgroundView"];
541
         UIView* backgroundView = [self.navigationController.navigationBar valueForKey:@"backgroundView"];
641
 #endif
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
 -(void)processTitleView:(UIViewController*)viewController
655
 -(void)processTitleView:(UIViewController*)viewController
645
                   props:(NSDictionary*)props
656
                   props:(NSDictionary*)props
646
                   style:(NSDictionary*)style {
657
                   style:(NSDictionary*)style {