瀏覽代碼

fix flaky top bar transition

yogevbd 6 年之前
父節點
當前提交
3fd9cdfe5b
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      lib/ios/RNNRootViewController.m

+ 3
- 3
lib/ios/RNNRootViewController.m 查看文件

@@ -100,7 +100,7 @@
100 100
 		} if ([self.navigationItem.title isKindOfClass:[RNNCustomTitleView class]] && !_customTitleView) {
101 101
 			self.navigationItem.title = nil;
102 102
 		}
103
-    } else if (_customTitleView.superview == nil) {
103
+    } else if (_customTitleView && _customTitleView.superview == nil) {
104 104
         if ([self.navigationItem.title isKindOfClass:[RNNCustomTitleView class]] && !_customTitleView) {
105 105
             self.navigationItem.title = nil;
106 106
         }
@@ -120,7 +120,7 @@
120 120
 		} else if ([[self.navigationController.navigationBar.subviews lastObject] isKindOfClass:[RNNCustomTitleView class]] && !_customTopBar) {
121 121
 			[[self.navigationController.navigationBar.subviews lastObject] removeFromSuperview];
122 122
 		}
123
-    } else if (_customTopBar.superview == nil) {
123
+    } else if (_customTopBar && _customTopBar.superview == nil) {
124 124
         if ([[self.navigationController.navigationBar.subviews lastObject] isKindOfClass:[RNNCustomTitleView class]] && !_customTopBar) {
125 125
             [[self.navigationController.navigationBar.subviews lastObject] removeFromSuperview];
126 126
         }
@@ -140,7 +140,7 @@
140 140
 			[[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
141 141
 			self.navigationController.navigationBar.clipsToBounds = NO;
142 142
 		}
143
-    } if (_customTopBarBackground.superview == nil) {
143
+    } if (_customTopBarBackground && _customTopBarBackground.superview == nil) {
144 144
         if ([[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
145 145
             [[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
146 146
         }