浏览代码

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

yogevbd 6 年前
父节点
当前提交
335dd424a2
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12
    1
      ios/RCCViewController.m

+ 12
- 1
ios/RCCViewController.m 查看文件

@@ -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 {