React-native-navigation: Hiding bottomtabs leads to empty gap on Android

Created on 13 Nov 2018  路  3Comments  路  Source: wix/react-native-navigation

Issue Description

When I push a screen with bottomTabs: { visible: false }, the tab bar IS correctly hidden, but the rest of my app does not draw behind it, meaning my app displays a blank space where the tab bar used to be. I can work around it by explicitly setting visible: false, drawBehind: true. Is this an intentional change for v2?

Steps to Reproduce / Code Snippets / Screenshots

With {visible: false}
image

With {visible: false, drawBehind: true }
image

Looking at the code, I feel like a solution might be to change this statement https://github.com/wix/react-native-navigation/blob/master/lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabsPresenter.java#L112 to if (options.drawBehind.isTrue() || options.visible.isFalse())?

Thanks very much!


Environment

  • React Native Navigation version: 2.1.2
  • React Native version: 0.57.0
  • Platform(s) (iOS, Android, or both?): We use both, but this bug is on Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Android 8 simulator, debug. Haven't checked any other build types.

Most helpful comment

I was able to work around it by explicitly setting {drawBehind: true} :+1:

All 3 comments

Can confirm. I'm having the same issue. Actually, I just came here to open it and saw this one... Let me know if you find a way to fix this and I'll do the same.

I was able to work around it by explicitly setting {drawBehind: true} :+1:

Actually, it looks like this is expected behaviour https://wix.github.io/react-native-navigation/#/docs/layout-types?id=changing-bottomtabs-visibility

On Android, Visibility can be toggled dynamically using the mergeOptions command. When hiding BottomTabs, drawBehind: true should be specified in order for the screen to render behind the area which was previously allocated to the BottomTabs.

Was this page helpful?
0 / 5 - 0 ratings