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
This commit is contained in:
Jed Lau 2016-01-04 04:30:37 -08:00 committed by facebook-github-bot-5
parent e42c6d4446
commit 52220a96f9
1 changed files with 7 additions and 0 deletions

View File

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