react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[V2] Topbar issue hiding in topbar visible screen

Open webdevsyd opened this issue 8 years ago • 5 comments

Issue Description

I have an initial screen set in root that doesn't need a topbar so I set this in my component screen

static get options() { return { topBar: { visible: false, drawBehind: true, animate: false } } }

In my 2nd screen which has topBar I have this

static get options() { return { topBar: { visible: true, drawBehind: false, animate: false } } }

The problem however is when I click the back button, the topBar is flickering when hiding in the 2nd screen. Is there a way that the topBar will hide but will not flicker.

Environment

  • React Native Navigation version: ^2.0.2568
  • React Native version: ^0.56.0
  • Platform(s) (iOS, Android, or both?): IOS
  • Device info (Simulator/Device? OS version? Debug/Release?): iPhone 6, IOS 12

webdevsyd avatar Sep 29 '18 05:09 webdevsyd

I'm also experiencing this issue. I've tried merging options on componentDidAppear too but had no luck. Here's a recording of the issue I'm having with slow animations turned on: https://drive.google.com/file/d/1ciKy8Ycnp6BqlZuJ1rQAUHOcwwjvce6Q/view?usp=sharing

There's also an issue on Android where if the topBar is set to visible: false the space for the bar remains.

screenshot_1538664148

steve228uk avatar Oct 04 '18 14:10 steve228uk

@yogevbd Isn't this what you're currently working on?

@steve228uk You'll need to set drawBehind: true when hiding topBar on Android.

guyca avatar Oct 04 '18 14:10 guyca

Yes I'm on it

yogevbd avatar Oct 04 '18 15:10 yogevbd

Thanks @guyca!

steve228uk avatar Oct 04 '18 21:10 steve228uk

For those using modals, you also need to take in consideration if you show modal with a stack, e.g.:

Navigation.showModal({
      stack: {
        children: [
          {
            component: {
              name: target,
            },
          },
        ],
      },
    });

that would add a topBar, whilst if you just add a component, e.g:

Navigation.showModal({
      component: {
        name: target,
      },
    });

Then the topBar will be hidden, and no gap, and, therefore, you will not need to set topBar visibility whatsoever. Tested on version 2.0.2621

thalesgaldino avatar Oct 29 '18 22:10 thalesgaldino