From 52220a96f9b212e91d187bef9e79cf34fc57f51e Mon Sep 17 00:00:00 2001 From: Jed Lau Date: Mon, 4 Jan 2016 04:30:37 -0800 Subject: [PATCH] Export method to get current status bar height Summary: Addresses #2515 . Closes https://github.com/facebook/react-native/pull/5039 Reviewed By: svcscm Differential Revision: D2799224 Pulled By: nicklockwood fb-gh-sync-id: 8f0a0f229a1588b1033b0121868c1f82e4dc6684 --- React/Modules/RCTStatusBarManager.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/React/Modules/RCTStatusBarManager.m b/React/Modules/RCTStatusBarManager.m index dd29a0789..026d19012 100644 --- a/React/Modules/RCTStatusBarManager.m +++ b/React/Modules/RCTStatusBarManager.m @@ -89,6 +89,13 @@ RCT_EXPORT_MODULE() [self emitEvent:@"statusBarFrameWillChange" forNotification:notification]; } +RCT_EXPORT_METHOD(getHeight:(RCTResponseSenderBlock)callback) +{ + callback(@[@{ + @"height": @([UIApplication sharedApplication].statusBarFrame.size.height), + }]); +} + RCT_EXPORT_METHOD(setStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated) {