diff --git a/Examples/UIExplorer/StatusBarIOSExample.js b/Examples/UIExplorer/StatusBarIOSExample.js index ab649197eed994..28d5e2a7c07692 100644 --- a/Examples/UIExplorer/StatusBarIOSExample.js +++ b/Examples/UIExplorer/StatusBarIOSExample.js @@ -83,6 +83,26 @@ exports.examples = [{ ); }, +}, { + title: 'Status Bar Network Activity Indicator', + render() { + return ( + + StatusBarIOS.setNetworkActivityIndicatorVisible(true)}> + + setNetworkActivityIndicatorVisible(true) + + + StatusBarIOS.setNetworkActivityIndicatorVisible(false)}> + + setNetworkActivityIndicatorVisible(false) + + + + ); + }, }]; var styles = StyleSheet.create({ diff --git a/Libraries/Components/StatusBar/StatusBarIOS.ios.js b/Libraries/Components/StatusBar/StatusBarIOS.ios.js index adfed78b7b23a5..59369ef143dd37 100644 --- a/Libraries/Components/StatusBar/StatusBarIOS.ios.js +++ b/Libraries/Components/StatusBar/StatusBarIOS.ios.js @@ -35,6 +35,10 @@ var StatusBarIOS = { animation = animation || 'none'; RCTStatusBarManager.setHidden(hidden, animation); }, + + setNetworkActivityIndicatorVisible(visible: boolean) { + RCTStatusBarManager.setNetworkActivityIndicatorVisible(visible); + }, }; module.exports = StatusBarIOS; diff --git a/React/Modules/RCTStatusBarManager.m b/React/Modules/RCTStatusBarManager.m index cb9ddfe690a088..bf32f835cf5d77 100644 --- a/React/Modules/RCTStatusBarManager.m +++ b/React/Modules/RCTStatusBarManager.m @@ -71,4 +71,9 @@ - (dispatch_queue_t)methodQueue } } +RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible:(BOOL)visible) +{ + [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:visible]; +} + @end