react-native-parallax-scroll-view
react-native-parallax-scroll-view copied to clipboard
onPress events do not take effect , goBack() Did not perform
render() { return ( <View style={{flex: 1}}> <ParallaxScrollView parallaxHeaderHeight={270} renderForeground={this.renderForeground} > {this.renderContent()} </ParallaxScrollView> </View> ); }
// header renderForeground=() => { return <View style={styles.foreground} key="parallax-header"> <View style={styles.Icons}> <TouchableOpacity onPress={this.goBack}> <Ionicons name={'ios-arrow-back'} size={26} color={'white'}/> </TouchableOpacity> </View> };
// important: goBack() Did not perform
goBack = () => {
let {navigation} = this.props;
navigation.goBack()
};
I defined an icon button in the renderForeground, hoping to return to the previous page by clicking the icon button, but this icon button did not return to the previous page. You can go back to the previous page if you define the icon button elsewhere. Why the icon button defined in the renderForeground cannot return to the previous page, and why the onPress event is not executed for the icon defined in the renderForeground
@xushan1303616 xushan1303616 facing same problem on my application, please share if you get any solution