Browse Source

Fix topBarHeight with UIModalPresentationPageSheet (#5749)

Yogev Ben David 4 years ago
parent
commit
9ef61a9a13
No account linked to committer's email address

+ 1
- 1
lib/ios/Constants.m View File

@@ -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 View File

@@ -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 View File

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