Skip to content

Commit

Permalink
Fix topBarHeight with UIModalPresentationPageSheet (#5749)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd authored Dec 9, 2019
1 parent 4cb0e98 commit 9ef61a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/ios/Constants.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ + (NSDictionary *)getConstants {
}

+ (CGFloat)topBarHeight {
return [UIApplication.sharedApplication.delegate.window.rootViewController getTopBarHeight];
return [RCTPresentedViewController() getTopBarHeight];
}

+ (CGFloat)statusBarHeight {
Expand Down
4 changes: 0 additions & 4 deletions lib/ios/RNNStackController.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ - (UIViewController *)getCurrentChild {
return self.topViewController;
}

- (CGFloat)getTopBarHeight {
return self.navigationBar.frame.size.height;
}

- (UINavigationController *)navigationController {
return self;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/ios/UINavigationController+RNNOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,8 @@ - (void)setBackButtonIcon:(UIImage *)icon withColor:(UIColor *)color title:(NSSt
lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
}

- (CGFloat)getTopBarHeight {
return self.navigationBar.frame.size.height;
}

@end

0 comments on commit 9ef61a9

Please sign in to comment.