React Navigation V6 Modal带有scrollview内部 - 当Top Scrollview到达时向下滑动模式
我对React-Navigation V6的模态表达有问题,以呈现带有卷轴的模态。 实际上,如果我可以手势向下滑动模态,那么如果里面有卷轴浏览,它就不起作用,并且我只能在标头上滑动。
我需要在达到Scrollview顶部时,必须开始删除动画手势。 这是预期的行为:
这是rootNavigation内部使用的代码:
<RootStack.Group screenOptions={{ presentation: 'modal', cardOverlayEnabled: true, ...TransitionPresets.ModalPresentationIOS }}>
<RootStack.Screen
component={ModalPage}
name="ModalPage"
options={ModalPageNavOptions}
/>
</RootStack.Group>
这是 modalpage.js
<ScrollView nestedScrollEnabled>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
</ScrollView>
ps的渲染:我正在使用Expo
I have a problem with the modal-presentation of react-navigation v6 to present a modal with ScrollView inside of it.
Actually if I enable gesture to swipe down the modal, it doesn't work if there is a ScrollView inside and I can swipe down only on the header.
I need that when reaching the ScrollView's top, must start dismiss animation gesture.
This is the expected behavior:
This is the code used inside the RootNavigation:
<RootStack.Group screenOptions={{ presentation: 'modal', cardOverlayEnabled: true, ...TransitionPresets.ModalPresentationIOS }}>
<RootStack.Screen
component={ModalPage}
name="ModalPage"
options={ModalPageNavOptions}
/>
</RootStack.Group>
This is render of ModalPage.js
<ScrollView nestedScrollEnabled>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
<Text>TEST TEXT</Text>
</ScrollView>
PS: I'm using expo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于iOS,可以使用本机stack navigator 具有相同的代码您已经提供了。
如果您仍然只想仅使用堆栈导航器,则在这里来自其他人的解决方案,但我不能确定他们运行良好。
For iOS, this behavior is possible to achieve with Native Stack Navigator with the same code you've provided.
If you still want to use just the Stack Navigator then here are some solutions from other people but I can't say for sure that they work well.