Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onPress events do not take effect , goBack() Did not perform #149

Open
xushan1303616 opened this issue Oct 10, 2020 · 2 comments
Open

onPress events do not take effect , goBack() Did not perform #149

xushan1303616 opened this issue Oct 10, 2020 · 2 comments

Comments

@xushan1303616
Copy link

render() {
return (
<View style={{flex: 1}}>
<ParallaxScrollView
parallaxHeaderHeight={270}
renderForeground={this.renderForeground}
>
{this.renderContent()}


);
}

// header
renderForeground=() => {
return

<TouchableOpacity onPress={this.goBack}>
<Ionicons name={'ios-arrow-back'} size={26} color={'white'}/>


};

// important: goBack() Did not perform
goBack = () => {
let {navigation} = this.props;
navigation.goBack()
};

@xushan1303616
Copy link
Author

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

@RevanthGovindan
Copy link

@xushan1303616 xushan1303616 facing same problem on my application, please share if you get any solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants