question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(1.0.0) Header component height issue in android

See original GitHub issue

Am able to reproduce the same issue that i reported earlier in beta version.(https://github.com/react-native-training/react-native-elements/issues/1574#issue-380651167)

I was trying to use the Header component in my app, the header component was working as expected in iOS but in Android I am getting status bar height along with the header component. Is there anyway to remove the status bar height from Android.

Here is the code snippet I have used:

<Header
          backgroundColor='transparent'
          containerStyle={{ width: '100%', backgroundColor: '#3488C0', borderBottomWidth: 0 }}
          leftComponent={{ icon: 'menu', color: '#fff', underlayColor: '#3488C0', onPress: () => this.toggleMenu(), }}
          centerComponent={{
            text: 'My History',
            style: {
              fontSize: 20,
              fontWeight: 'bold',
              fontFamily: Fonts.Lato,
              color: 'white'
            }
          }}
        />

Here is the result I am getting in Android and iOS:

Example: iOS: screen shot 2019-02-19 at 7 50 31 pm screen shot 2019-02-19 at 7 50 57 pm Android: screen shot 2019-02-19 at 7 55 09 pm

Environment :

software version
react-native-elements 1.0.0
react-native 0.58.4
npm 6.7.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:23
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

31reactions
GutoLusilocommented, Mar 29, 2019

I had the same issue. I know it’s kind of a workaround, but I solved this for me adding this prop:

containerStyle={{ paddingTop: 0 }}

28reactions
McFly78commented, Feb 20, 2019

Yes I use react-navigation. I tried on StackNavigator and TabNavigator and have the same issue.

As a workaround I use the following parameter :

statusBarProps={ translucent: true, }

Read more comments on GitHub >

github_iconTop Results From Across the Web

programmatically retrieve Header component height - React ...
Header does not expose Height. I faced the same problem and I dove into the code, I realized Height is harcoded in this...
Read more >
react-native-image-header-scroll-view - npm
A ScrollView-like component that: Has a fixed image header; Keep the image as a nav bar; Works on iOS and Android. Breaking changes....
Read more >
Changelog | Duet Design System
Automatic creation of documentation based on tokens defined. Fixes a bug in Spacer component when the horizontal spacing is used. Makes the footer...
Read more >
Media3 - Android Developers
Add Player.getSurfaceSize that returns the size of the surface on which the video is rendered. Fix bug where removing listeners during the player...
Read more >
Android ConstraintLayout Example Tutorial - DigitalOcean
Google had introduced android constraint layout editor at Google I/O ... 'com.android.support.constraint:constraint-layout:1.0.0-beta4' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found