Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

With react native navigation on iOS, how to change the background color of the status bar when the app is in background?

$
0
0

I am trying to change the background colour of the status bar, in iOS, when the app goes in background to let the user know that the app is running in the background.but no success so far.

My code looks like that:

function _handleAppStateChange(nextAppState) {    if (this.state.appState.match(/inactive|background/) && nextAppState === "active") {          Navigation.mergeOptions(component.id, {              statusBar: {                  visible: false,              }          });    }else if(this.state.appState.match(/active/) && nextAppState === "inactive"){          Navigation.mergeOptions(component.id, {              statusBar: {                  visible: true,                  backgroundColor: 'yellow',              }          });    }    this.setState({ appState: nextAppState });};

If it is not possible to do it via react-native-navigation, would it be possible with objective-c?

Thanks in advance for you help!


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>