React-native-navigation: [v2][Android] Hiding TopBar leaves a gap

Created on 3 Oct 2018  路  8Comments  路  Source: wix/react-native-navigation

Issue Description

When you set top bar visibility to false it still leaves a gap instead of completely hiding like it does on iOS.

Steps to Reproduce / Code Snippets / Screenshots

topBar: {
    visible: false,
}

You can get around it by doing the following:

topBar: {
    visible: true,
    height: 0,
}

However that is really inconvenient if you have a mix of screens with no top bar and screens with top bars. There is also a slight flicker when you do this.


Environment

  • React Native Navigation version: 2.0.2571
  • React Native version: 0.53
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator & Device
questiostack overflow

Most helpful comment

@Mikunj You're absolutely right it's a bug! And thank you for providing a solution.
@guyca why did you close thise?

All 8 comments

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the react-native-navigation tag.

@guyca This isn't a question, it's a bug. On version 2.0.2555 setting the visibility of the top bar to false completely hides it (no gap is left), however on 2.0.2571 it hides the bar but there's still a gap left at the top.

@Mikunj You're absolutely right it's a bug! And thank you for providing a solution.
@guyca why did you close thise?

This is happening on version ^2.1.3-patch.2

Still happening on 2.18.5 both with adding height: 0 on my Navigation.setRoot() element component and also inside my individual screens, setting the options at the top:

static get options() {
    return {
        topBar: {
            visible: false,
            height: 0,
        }
    }
}

There must be something stale, bc it happens on my emmulators even when running gradle clean and deleting/reinstalling the app, but it's not happening on my device with an alpha release installed

can confirm, still happening on android

Was this page helpful?
0 / 5 - 0 ratings

Related issues

no23reason picture no23reason  路  3Comments

switchtrue picture switchtrue  路  3Comments

zhanguangao picture zhanguangao  路  3Comments

viper4595 picture viper4595  路  3Comments

kiroukou picture kiroukou  路  3Comments