mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-09 22:51:57 +08:00
fix: don't set a header height when a custom header is specified
This commit is contained in:
@@ -84,13 +84,15 @@ export default function HeaderContainer({
|
||||
isFocused ? 'auto' : 'no-hide-descendants'
|
||||
}
|
||||
style={[
|
||||
{ height: getDefaultHeaderHeight(layout) },
|
||||
mode === 'float' ? StyleSheet.absoluteFill : null,
|
||||
mode === 'screen' && options.header !== undefined
|
||||
? null
|
||||
: { height: getDefaultHeaderHeight(layout) },
|
||||
options.headerStyle,
|
||||
]}
|
||||
>
|
||||
{options.header !== undefined ? (
|
||||
options.header == null ? null : (
|
||||
options.header === null ? null : (
|
||||
options.header(props)
|
||||
)
|
||||
) : (
|
||||
|
||||
@@ -125,7 +125,8 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
<HeaderBackButton {...props} />
|
||||
),
|
||||
headerBackground,
|
||||
headerStatusBarHeight,
|
||||
// @ts-ignore
|
||||
headerStatusBarHeight = getStatusBarHeight(layout.width > layout.height),
|
||||
headerRight: right,
|
||||
headerBackImage: backImage,
|
||||
headerBackTitle: leftLabel,
|
||||
@@ -168,16 +169,8 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
{headerBackground()}
|
||||
</Animated.View>
|
||||
) : null}
|
||||
<View
|
||||
pointerEvents="none"
|
||||
style={{
|
||||
height:
|
||||
headerStatusBarHeight !== undefined
|
||||
? headerStatusBarHeight
|
||||
: getStatusBarHeight(layout.width > layout.height),
|
||||
}}
|
||||
/>
|
||||
<View pointerEvents="box-none" style={[styles.container]}>
|
||||
<View pointerEvents="none" style={{ height: headerStatusBarHeight }} />
|
||||
<View pointerEvents="box-none" style={styles.container}>
|
||||
{onGoBack ? (
|
||||
<Animated.View
|
||||
style={[styles.left, leftButtonStyle, leftContainerStyle]}
|
||||
|
||||
Reference in New Issue
Block a user