React-native-navigation: [v2] custom top bar background does not fill entire height on iPhone X

Created on 29 Jul 2018  ·  9Comments  ·  Source: wix/react-native-navigation

image

Steps to reproduce:

Run playground on iPhone X simulator


Environment

  • React Native Navigation version: wix/navigation@master
  • React Native version: wix/navigation@master
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): iPhone X
🏚 stale

Most helpful comment

This isn't fixed, and the problem is also present with any iOS device.

statusBar: { hideWithTopBar: true, }

works perfectly if you have a background color, but doesn't work when you have a custom top bar background component

All 9 comments

Add drawBehind: true

Won’t that just draw the screen view underneath the top bar?

Also facing this issue. Adding drawBehind: true does not solve the problem. Neither the background component nor the actual screen component is visible under the top most part of the topbar. It's like there is a white object on top of everything else.

static get options() {
  return {
    layout: {
      backgroundColor: colours.red
    },
    topBar: {
      drawBehind: true,
      background: {
        color: colours.red,
        component: {
          name: 'TopBar'
        }
      }
    }
  }
}

Produces the following. Note the white bar at the top of the image:

simulator screen shot - iphone x - 2018-08-04 at 10 01 11

Also facing this issue.
Neither drawBehind: true, nor within wrapper helps.

translucent: true, solved this issue for me:

Navigation.setDefaultOptions({
      statusBar: {
        visible: true,
        style: 'light',
        hideWithTopBar: false,
      },
      layout: {
        backgroundColor: '#f2a99a',
        orientation: ['portrait'],
      },
      topBar: {
        visible: true,
        translucent: true,
        background: {
          color: 'rgba(217, 73, 114, 0.5)',
          component: {
            name: 'TopBarBackground',
          },
        },
      },
...
})

screen shot 2018-08-15 at 12 34 59

Also I enabled View controller-based status bar appearance according to manual https://wix.github.io/react-native-navigation/v2/#/docs/styling?id=styling-the-statusbar

I am also experiencing this issue, and it prevents me from having a scrollview control the opacity of the navbar (start transparent, scroll down to make it opaque).

@dalamar I have copy-pasted your code and it does not work for me.

Has anyone had any luck getting a custom topBar component to draw behind the statusbar on any device?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

The issue has been closed for inactivity.

This isn't fixed, and the problem is also present with any iOS device.

statusBar: { hideWithTopBar: true, }

works perfectly if you have a background color, but doesn't work when you have a custom top bar background component

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bjacog picture bjacog  ·  3Comments

switchtrue picture switchtrue  ·  3Comments

charlesluo2014 picture charlesluo2014  ·  3Comments

yedidyak picture yedidyak  ·  3Comments

yayanartha picture yayanartha  ·  3Comments