简体   繁体   English

在React Native中的每个场景导航中处理后退按钮

[英]Handle Back Button in each scene navigation in react Native

I have included the back button as a image in the scene which i want back button, I want to perform the back action in the component, Is it possible? 我已经将后退按钮作为图像包含在场景中,我想要后退按钮,我想在组件中执行后退操作,这可能吗?

<Scene key=“Courses”  icon={TabIcon}  iconName=“book” backButtonImage={require(‘./app/icons/back.png’)}>
           <Scene key=“CourseList” component={CourseList}  title=“Courses”  navigationBarStyle={styles.navBarColor} titleStyle={styles.navBarTitleColor} />
           <Scene key=“levels” component={levels}  barButtonIconStyle={{ tintColor: ‘white’ }} navigationBarStyle={styles.navBarColor} titleStyle={styles.navBarTitleColor} leftButtonIconStyle = {{ tintColor:‘red’}} title=“”/>
           <Scene key=“Units” component={Units} barButtonIconStyle={{ tintColor: ‘white’ }} navigationBarStyle={styles.navBarColor} titleStyle={styles.navBarTitleColor} /></Scene>

What module are you using to handle navigation? 您正在使用哪个模块来处理导航?

Have you tried https://reactnavigation.org/ 您是否尝试过https://reactnavigation.org/

With this module, it's quite straightforward to handling this. 有了这个模块,就可以很简单地处理它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 丢失后退按钮 React Native Navigation - Lost the back button React Native Navigation 如何在 React-navigation/react-native 中隐藏后退按钮 - how to hide back button in React-navigation/react-native 使用 React Native Alert 来确认/阻止后退按钮导航 - Use a React Native Alert to confirm/block Back button navigation React Native 在抽屉导航屏幕上显示标题和后退按钮 - React Native show header and back button on drawer navigation screen React-Native 与 Expo:手柄硬件返回按钮 - React-Native with Expo: Handle Hardware Back Button 如何使用 react-native-router-flux 在每个场景中处理 backAndroidHandler - How do I handle backAndroidHandler in each scene using react-native-router-flux React Native 抽屉导航:如何通过单击特定场景中的自定义按钮打开抽屉? - React Native drawer navigation: how to open drawer by clicking custom button in specific scene? 如何阻止Android硬件后退按钮在react-native的react-navigation中运行? - How to stop the Android Hardware Back Button from functioning in react-navigation for react-native? 在react-native-router-flux中重置场景导航 - Reset scene navigation in react-native-router-flux 在 React Native 中以更简洁的方式处理 Typescript 中的导航 - Cleaner way to handle Navigation in Typescript in React Native
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM