【发布时间】:2019-08-04 08:18:33
【问题描述】:
抽屉导航有问题。我不能从左到右拖动抽屉,当我用按钮打开抽屉时,我不能按抽屉外面来关闭它。
它适用于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',
},
},
}
);
【问题讨论】:
-
这对我有帮助 (shift.infinite.red/…)
标签: reactjs react-native navigation react-navigation