[英]React Native - NavigatorIOS - Disable pop gesture
I am trying to disable the swipe back gesture in NavigatorIOS which pops the current scene.我试图在弹出当前场景的 NavigatorIOS 中禁用向后滑动手势。
I have seen methods using Navigator.SceneConfigs but none of this applies to NavigatorIOS.我见过使用 Navigator.SceneConfigs 的方法,但这些都不适用于 NavigatorIOS。
My current code as it stands is as follows.我目前的代码如下。
<NavigatorIOS
style={styles.container}
initialRoute={{
title: 'Favourites',
component: Favourites,
passProps: {
content: this.state.content,
user: this.state.userLoggedIn,
favsPage: false,
setFavourites: this.setFavourites,
alterContent: this.alterContent,
retrieve: this.retrieve,
retrieveContent: this.retrieveContent,
events: this.eventEmitter
}
}}/>
Try playing with the various replace methods.尝试使用各种替换方法。 They may get you the desired affect.
他们可能会给你带来想要的效果。
replace(route)
- Replace the route for the current page and immediately load the view for the newreplace(route)
- 替换当前页面的路由并立即加载新页面的视图
routereplacePrevious(route)
- Replace the route/view for the previous pageroutereplacePrevious(route)
- 替换上一页的路由/视图
replacePreviousAndPop(route)
- Replaces the previous route/view and transitions back to itreplacePreviousAndPop(route)
- 替换之前的路由/视图并转换回它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.