React-native-navigation: iPhone X status bar does not have topBar color by default

Created on 1 May 2018  ·  5Comments  ·  Source: wix/react-native-navigation

iPhone X status bar does not have navbar color by default

On the iPhone X, when presenting a navbar/topBar the status bar color should default to that of the navbar. However that currently does not happen, rather the status bar seems to default to the

Steps to Reproduce / Code Snippets / Screenshots

Here is what happens currently in React Native Navigation:
simulator screen shot - iphone x - 2018-05-01 at 09 07 03
(A screenshot taken from the simulator of the topBar, notice the white part above the navbar which is is where the iPhone X get its status bar background color from.)


Environment

  • React Native Navigation version: 2.0.2274
  • React Native version: 0.52.2
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator, iOS 11.3, Both
iOS more info needed v2

Most helpful comment

This is still an issue and no ones on the web explains how to get it right for iphone x simulator.

Can someone please explain the fix for IOS status bar

All 5 comments

@RubenSandwich Can you post here your options object?

@yogevbd

Passed in options:

    topBar: {
      title: {
        color: '#FFFFFF',
        text: 'Events',
      },
      background: {
        color: '#313E61',
      },
      leftButtons: [
        {
          id: 'EventsScreenNavBarButtons.Settings',
          disableIconTint: true,
          buttonColor: '#FFFFFF',
          icon: require('@images/gear.png'),
        },
      ],
    },

Setting the navigation root:

Navigation.setRoot({
    stack: {
      children: [
        {
          component: {
            name: EVENTSSCREENID,
          },
        },
      ],
    },
  });

Here is a better simulator screenshot as well:
untitled

Same issue here, can I change the color manually? @RubenSandwich did u make any workaround?

Those are my options:

options: {
  statusBarStyle: 'light',
  animationType: 'slide-horizontal',
  topBar: {
    title: {
      text: account.name,
      color: 'white' 
     },
    background: { color }
  }}
}

And here is the result:

image

Just an update on this, it seems to be fixed in v2.0.2348.

This is still an issue and no ones on the web explains how to get it right for iphone x simulator.

Can someone please explain the fix for IOS status bar

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edcs picture edcs  ·  3Comments

switchtrue picture switchtrue  ·  3Comments

zhanguangao picture zhanguangao  ·  3Comments

henrikra picture henrikra  ·  3Comments

charlesluo2014 picture charlesluo2014  ·  3Comments