React-native-navigation: [V4] StatusBar not hiding in android after add react native navigation

Created on 2 Feb 2020  ·  3Comments  ·  Source: wix/react-native-navigation

Issue Description

It is the same issue as facebook/react-native#27035 - The StatusBar not hiding on android but IOS. I found it only happen when I add react-native-navigation.

Steps to Reproduce / Code Snippets / Screenshots

I made a new clean react-native project (0.61.5) and it hiding perfectly. It will have white blank statue bar like below screenshot if we add react native navigation.

How I hide the status bar:

import { StatusBar } from 'react-native';

<StatusBar hidden />

Screen Shot 2020-02-03 at 12 42 16 AM

Reproduce

  1. Clone reproduce repo
  2. yarn install
  3. npx react-native run-android

Environment

  • React Native Navigation version: 4.5.5
  • React Native version: 0.61.5
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator & Device/Any versions

Most helpful comment

Hey @jinshin1013
Resolving StatusBar options from default options will be fixed in the next major version, which should be published today. Thanks 👍
@Jazznight Don't use the StatusBar component with RNN, instead manipulate the StatusBar through options.

All 3 comments

If you add this, it should draw behind the StatusBar:

Navigation.setRoot({
  root: {
    stack: {
      children: [{
        component: {
          id: 'test_bar.appScreen',
          name: 'test_bar.appScreen',
          options: {
            statusBar: {
              drawBehind: true,
              visible: false
            }
          }
        },
      }],
    }
  }
});

Keep in mind when I tested this setting the statusBar option in Navigation.setDefaultOptions did not resolve the issue.

Hey @jinshin1013
Resolving StatusBar options from default options will be fixed in the next major version, which should be published today. Thanks 👍
@Jazznight Don't use the StatusBar component with RNN, instead manipulate the StatusBar through options.

@jinshin1013 Thanks, It hiding perfectly. I will also remove all the all the <StatusBar hidden /> for both IOS and Android.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhanguangao picture zhanguangao  ·  3Comments

swingywc picture swingywc  ·  3Comments

viper4595 picture viper4595  ·  3Comments

charlesluo2014 picture charlesluo2014  ·  3Comments

henrikra picture henrikra  ·  3Comments