mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-28 20:35:19 +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'
|
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)
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -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]}
|
||||||
|
|||||||
Reference in New Issue
Block a user