如何锁抽屉菜单只在一些屏幕栈?



我需要做的就是阻止滑动操作来打开堆栈中特定屏幕上的菜单

堆栈:

const SignedInStack = () => (
<Stack.Navigator>
<Stack.Screen name='Confluence' component={Confluence} />
<Stack.Screen name='QRCode' component={Main} />
<Stack.Screen name='Notifications' component={Notifications} />
</Stack.Navigator>
)

DrawerMenu:

const DrawerMenu = () => (
<Drawer.Navigator
screenOptions={{ headerShown: false }}
drawerContent={(props) => <CustomDrawerContent {...props} />}
>
<Drawer.Screen
name="SignedInStack"
component={SignedInStack}
/>
<Drawer.Navigator/>
);

App.js:

const App = () => (
<NavigationContainer>
<DrawerMenu />
</NavigationContainer>
);

您试过使用" swipeenabled "吗?

options={{ swipeEnabled: false }}

https://reactnavigation.org/docs/drawer-navigator/

最新更新