Header component height issue in android
See original GitHub issueHi 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
centerComponent={<Text>Title</Text>}
rightComponent={
<Image source={require('../../assets/images/navbar-logout.png')} />
}
/>
Here is the result I am getting in Android and iOS:

Versions: react-native-elements: ^0.18.5 react: 16.0.0 react-native: 0.51.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:21
Top Results From Across the Web
(1.0.0) Header component height issue in android #1793
I was trying to use the Header component in my app, the header component was working as expected in iOS but in Android...
Read more >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 >min-height - CSS: Cascading Style Sheets - MDN Web Docs
The min-height CSS property sets the minimum height of an element. It prevents the used value of the height property from becoming smaller ......
Read more >Stack Navigator | React Navigation
Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack....
Read more >Height and Width - React Native
A component can only expand to fill available space if its parent has dimensions greater than 0 . If a parent does not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
this is what is did with the latest version
import { StatusBar } from 'react-native';
<Header containerStyle={{ marginTop: ((StatusBar.currentHeight || 0) * -1) }} />
The height of the status bar is set as a fixed 70 units https://github.com/react-native-training/react-native-elements/blob/4f8225d91bd5917c88b3e70e27a991b12ad4dd1d/src/header/Header.js#L101
On iOS the statusBar overlaps the content, while on android it does not. An easy fix would be to set height for android to
70 - 24
in which 24 is the height of the status bar on android.A quick workaround in your case would be to change the height of the StatusBar by using the
outContainerStyles
prop.That way it’ll be 70 on iOS as expected and 56 on android