mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-23 20:10:49 +08:00
fix: fix back button not working in header
This commit is contained in:
@@ -295,6 +295,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
<View pointerEvents="box-none" style={styles.content}>
|
||||
{onGoBack ? (
|
||||
<Animated.View
|
||||
pointerEvents="box-none"
|
||||
style={[styles.left, leftButtonStyle, leftContainerStyle]}
|
||||
>
|
||||
{left({
|
||||
@@ -315,6 +316,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
) : null}
|
||||
{currentTitle ? (
|
||||
<Animated.View
|
||||
pointerEvents="box-none"
|
||||
style={[
|
||||
Platform.select({
|
||||
ios: null,
|
||||
@@ -336,6 +338,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
) : null}
|
||||
{right ? (
|
||||
<Animated.View
|
||||
pointerEvents="box-none"
|
||||
style={[styles.right, rightButtonStyle, rightContainerStyle]}
|
||||
>
|
||||
{right({ tintColor: headerTintColor })}
|
||||
|
||||
@@ -353,7 +353,7 @@ export default class Stack extends React.Component<Props, State> {
|
||||
focusedOptions.headerStyleInterpolator !== undefined
|
||||
? focusedOptions.headerStyleInterpolator
|
||||
: defaultTransitionPreset.headerStyleInterpolator,
|
||||
style: [styles.header, styles.floating],
|
||||
style: styles.floating,
|
||||
})
|
||||
: null}
|
||||
</React.Fragment>
|
||||
@@ -366,10 +366,6 @@ const styles = StyleSheet.create({
|
||||
flex: 1,
|
||||
overflow: 'hidden',
|
||||
},
|
||||
header: {
|
||||
// This is needed to show elevation shadow
|
||||
zIndex: Platform.OS === 'android' ? 1 : 0,
|
||||
},
|
||||
floating: {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
|
||||
@@ -47,17 +47,14 @@ export default class TouchableItem extends React.Component<Props> {
|
||||
Platform.OS === 'android' &&
|
||||
Platform.Version >= ANDROID_VERSION_LOLLIPOP
|
||||
) {
|
||||
const { style, ...rest } = this.props;
|
||||
const { style, pressColor, borderless, children, ...rest } = this.props;
|
||||
|
||||
return (
|
||||
<TouchableNativeFeedback
|
||||
{...rest}
|
||||
style={null}
|
||||
background={TouchableNativeFeedback.Ripple(
|
||||
this.props.pressColor,
|
||||
this.props.borderless
|
||||
)}
|
||||
background={TouchableNativeFeedback.Ripple(pressColor, borderless)}
|
||||
>
|
||||
<View style={style}>{React.Children.only(this.props.children)}</View>
|
||||
<View style={style}>{React.Children.only(children)}</View>
|
||||
</TouchableNativeFeedback>
|
||||
);
|
||||
} else if (Platform.OS === 'ios') {
|
||||
|
||||
Reference in New Issue
Block a user