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

edcs picture edcs  路  3Comments

tmaly1980 picture tmaly1980  路  3Comments

henrikra picture henrikra  路  3Comments

yedidyak picture yedidyak  路  3Comments

kiroukou picture kiroukou  路  3Comments