防止在React Navigation堆栈屏幕中运行常见事件

问题描述 投票:0回答:1
<Stack.Navigator>
    <Stack.Screen name="Home" component={Screens.Home} />
    <Stack.Screen name="Blog" component={Screens.Blog} />
</Stack.Navigator>

当我导航到Blog stack时,此屏幕中的某些事件(例如BackHandleropen keyboard when focus on Textinput,...)影响Home screen

新屏幕如何在堆栈导航中作为独立屏幕工作?


如果我的问题提出的不正确,请帮助我编辑我的问题

react-native react-native-android react-navigation react-navigation-stack react-navigation-v5
1个回答
0
投票

您可以将gestureEnabled属性初始化为false,以防止发生默认的后退事件,其他选项也可以用来禁止本地激活的事件。

如果要删除标题,可以通过将headerMode属性的null归为null来完成

© www.soinside.com 2019 - 2024. All rights reserved.