我有抽屉导航的问题。我无法从左向右拖动抽屉,当我从按钮打开抽屉时,我无法按下抽屉外面以关闭它。
它适用于expo
但不适用于react-native init
。
这是我想要实现的目标:
这是我的代码:
const AppDrawerNavigator = createDrawerNavigator(
{
Home: {
screen: Home,
navigationOptions: {
drawerLockMode: 'locked-closed',
drawerIcon: (
<Image
style={{ width: 30, height: 30 }}
source={require('./assets/IconDrawerNavigation/home.png')}
/>
),
},
},
AboutUs: {
screen: AboutUs,
navigationOptions: {
drawerIcon: (
<Image
style={{ width: 30, height: 30 }}
source={require('./assets/IconDrawerNavigation/about-us.png')}
/>
),
},
},
Logout: {
screen: HomePage,
navigationOptions: {
drawerIcon: (
<Image
style={{ width: 30, height: 30 }}
source={require('./assets/IconDrawerNavigation/logout.png')}
/>
),
},
},
},
{
contentComponent: CustomDrawerComponent,
contentOptions: {
// activeBackgroundColor: 'red',
labelStyle: {
fontFamily: 'SomeFont',
color: 'white',
},
},
}
);