React-native-router-flux: Change Statusbar Color?

Created on 1 Apr 2016  Β·  9Comments  Β·  Source: aksonov/react-native-router-flux

I can't seem to find a way to change the very top status bar (iphone) to be dark background with white icons, since the navbar I am using is dark. Any idea how to get it to work? I looked into react native's documentation on Status Bar but can't seem to understand what is needed, or if there is a way to do it with this plugin. Any ideas?

Most helpful comment

You can call StatusBar.setBarStyle('light-content', true); to change the status bar text/icons to white. Remember to include StatusBar from react-native.

All 9 comments

AFIKT it cannot be done on iOS. The docs are quite clear about it.

@jeroenbourgois Hmmm.. I must have missed that, where specifically does it say it cannot be done in iOS? There has got be a way to have it work on dark navbar :)

You can call StatusBar.setBarStyle('light-content', true); to change the status bar text/icons to white. Remember to include StatusBar from react-native.

@lee-gray Works great! Thanks man :)

@lee-gray Thanks!
rad-sunny-delight-d-ja8v9vQFdbCiQ

Fantastic!!

Thanks!

cannot use backgroundColor in StatusBar in IOS, it only works in android. use setBarStyle={color} or set backgroundColor in View that covers StatusBar instead :)

There's this way.

<Scene
  key="tabbar"
  tabs={true}
  πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»
  onSelect={el => {
    if (typeof Actions !== 'object') return;
    const {
      sceneKey,
      statusBarStyle
    } = el.props
    if (statusBarStyle) {
      StatusBar.setBarStyle(statusBarStyle, true)
      Actions[sceneKey]()
    }
  }}>
  <Scene
    key="tab_1"
    title="home"
    component={Home}
    icon={TabIcon}
    πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»πŸ‘‡πŸ»
    statusBarStyle="light-content" />
.
.
.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

booboothefool picture booboothefool  Β·  3Comments

sreejithr picture sreejithr  Β·  3Comments

basdvries picture basdvries  Β·  3Comments

maphongba008 picture maphongba008  Β·  3Comments

GCour picture GCour  Β·  3Comments