瀏覽代碼

Fix topBarHeight with UIModalPresentationPageSheet (#5749)

Yogev Ben David 5 年之前
父節點
當前提交
9ef61a9a13
No account linked to committer's email address
共有 3 個檔案被更改,包括 5 行新增5 行删除
  1. 1
    1
      lib/ios/Constants.m
  2. 0
    4
      lib/ios/RNNStackController.m
  3. 4
    0
      lib/ios/UINavigationController+RNNOptions.m

+ 1
- 1
lib/ios/Constants.m 查看文件

@@ -8,7 +8,7 @@
8 8
 }
9 9
 
10 10
 + (CGFloat)topBarHeight {
11
-	return [UIApplication.sharedApplication.delegate.window.rootViewController getTopBarHeight];
11
+	return [RCTPresentedViewController() getTopBarHeight];
12 12
 }
13 13
 
14 14
 + (CGFloat)statusBarHeight {

+ 0
- 4
lib/ios/RNNStackController.m 查看文件

@@ -18,10 +18,6 @@
18 18
 	return self.topViewController;
19 19
 }
20 20
 
21
-- (CGFloat)getTopBarHeight {
22
-	return self.navigationBar.frame.size.height;
23
-}
24
-
25 21
 - (UINavigationController *)navigationController {
26 22
 	return self;
27 23
 }

+ 4
- 0
lib/ios/UINavigationController+RNNOptions.m 查看文件

@@ -114,4 +114,8 @@ const NSInteger BLUR_TOPBAR_TAG = 78264802;
114 114
     lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
115 115
 }
116 116
 
117
+- (CGFloat)getTopBarHeight {
118
+    return self.navigationBar.frame.size.height;
119
+}
120
+
117 121
 @end