【发布时间】:2019-08-22 13:50:10
【问题描述】:
我必须在两侧做 2 个抽屉和一个底部标签导航器。我试图用 react-navigation 来做,但我做不到,因为 openDrawer 代码只打开了其中一个,所以我卡住了,请帮帮我。如何提供抽屉 ID、钥匙或其他方法。
反应原生
<Button onPress={this.props.navigation.openDrawer}>
<Button/> //left drawer opens
<Button onPress={this.props.navigation.openDrawer}>
<Button/>
我试过你的代码,但我得到了 TypeError: undefined is not an object (评估“this.props.navigation.dispatch”)
<Button title='open the drawer' onPress={this.props.navigation.dispatch(DrawerActions.openDrawer('drawerOpenLeft'))}></Button>
<Button title='open the drawer right' onPress={this.props.navigation.dispatch(DrawerActions.openDrawer('drawerOpenRight'))}></Button>
【问题讨论】:
标签: react-native react-native-drawer