我试图在底栏中打开一个抽屉,但是它没有用,抽屉没有打开,但是单击时可以看到抽屉的覆盖物,但是看不到我自定义的抽屉。我需要一个解决方案来通过单击按钮打开和关闭抽屉。滑动即可打开抽屉,效果很好,但是只需按一下按钮即可打开。预先感谢。
this.props.navigation.toggleDrawer()
this.props.navigation.navigate("DrawerOpen")
this.props.navigation.dispatch(DrawerActions.openDrawer())
这是我的抽屉配置...
const Drawer = createDrawerNavigator(
{
Home: {
screen: Home,
},
},
{
initialRouteName: 'Home',
contentOptions: {
activeTintColor: '#548ff7',
activeBackgroundColor: 'transparent',
inactiveTintColor: '#000',
inactiveBackgroundColor: 'transparent',
labelStyle: {
fontSize: height / 100 * 2.2,
marginLeft: width / 100 * 1, fontWeight: '400'
},
style: { justifyContent: 'center' }
},
drawerWidth: SCREEN_WIDTH * 0.8,
contentComponent: DrawerComponent,
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle',
drawerPosition:"right"
}
)