fix: don't set a header height when a custom header is specified

This commit is contained in:
satyajit.happy
2019-06-14 14:56:58 +02:00
parent 4e2afa0799
commit 1b82e25bb4
2 changed files with 8 additions and 13 deletions

View File

@@ -84,13 +84,15 @@ export default function HeaderContainer({
isFocused ? 'auto' : 'no-hide-descendants' isFocused ? 'auto' : 'no-hide-descendants'
} }
style={[ style={[
{ height: getDefaultHeaderHeight(layout) },
mode === 'float' ? StyleSheet.absoluteFill : null, mode === 'float' ? StyleSheet.absoluteFill : null,
mode === 'screen' && options.header !== undefined
? null
: { height: getDefaultHeaderHeight(layout) },
options.headerStyle, options.headerStyle,
]} ]}
> >
{options.header !== undefined ? ( {options.header !== undefined ? (
options.header == null ? null : ( options.header === null ? null : (
options.header(props) options.header(props)
) )
) : ( ) : (

View File

@@ -125,7 +125,8 @@ export default class HeaderSegment extends React.Component<Props, State> {
<HeaderBackButton {...props} /> <HeaderBackButton {...props} />
), ),
headerBackground, headerBackground,
headerStatusBarHeight, // @ts-ignore
headerStatusBarHeight = getStatusBarHeight(layout.width > layout.height),
headerRight: right, headerRight: right,
headerBackImage: backImage, headerBackImage: backImage,
headerBackTitle: leftLabel, headerBackTitle: leftLabel,
@@ -168,16 +169,8 @@ export default class HeaderSegment extends React.Component<Props, State> {
{headerBackground()} {headerBackground()}
</Animated.View> </Animated.View>
) : null} ) : null}
<View <View pointerEvents="none" style={{ height: headerStatusBarHeight }} />
pointerEvents="none" <View pointerEvents="box-none" style={styles.container}>
style={{
height:
headerStatusBarHeight !== undefined
? headerStatusBarHeight
: getStatusBarHeight(layout.width > layout.height),
}}
/>
<View pointerEvents="box-none" style={[styles.container]}>
{onGoBack ? ( {onGoBack ? (
<Animated.View <Animated.View
style={[styles.left, leftButtonStyle, leftContainerStyle]} style={[styles.left, leftButtonStyle, leftContainerStyle]}