React-native-navigation: Transparent topBar with drawBehind set to true shows anyway on iOS

Created on 4 Sep 2019  ·  3Comments  ·  Source: wix/react-native-navigation

Issue Description

This might be related to #4221

I'm trying to render a transparent topBar with drawBehind true. On Android it works kind of fine (still see a little bit of white space on top of it) but on iOS it just ignores that the topBar is supposed to be transparent. However, when I scroll, it does show the content behind the topbar:

ezgif-1-dfb25c45918b

Steps to Reproduce / Code Snippets / Screenshots

These are the options I'm using

topBar: {
        title: {
          text: 'My Title',
        },
        background: {
          color: 'transparent',
        },
       drawBehind: true,
},

Is there something else I should be applying to make the content visible behind the topbar?


Environment

  • React Native Navigation version: 3.1.2
  • React Native version: 0.59.8
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): iPhone XR iOS 12.4 Debug

Most helpful comment

Update: after clearing the cache and rebuilding (without changing anything) it showed it exactly as I expected from the start on both platforms. I think it's safe to close!

Also: make sure you add contentInsetAdjustmentBehavior="never" as a prop inside your ScrollView/FlatList/SectionList if you're using one

All 3 comments

Update: after clearing the cache and rebuilding (without changing anything) it showed it exactly as I expected from the start on both platforms. I think it's safe to close!

Also: make sure you add contentInsetAdjustmentBehavior="never" as a prop inside your ScrollView/FlatList/SectionList if you're using one

I have same problem on android...

contentInsetAdjustmentBehavior is a huge one. This should be documented.

@samcampisi thanks for saving me time here!

Was this page helpful?
0 / 5 - 0 ratings