我必须在两侧做 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 (evalating '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>