侧滑导航好像在真机上滑动不会打开
import {DrawerItems,createDrawerNavigator, createStackNavigator, createBottomTabNavigator, createMaterialTopTabNavigator, TabRouter } from 'react-navigation';
import React from 'react';
import {Button, Platform, ScrollView, SafeAreaView } from 'react-native';
import HomePage from '../page/homePage';
import Page1 from '../page/page1';
import Page2 from '../page/page2';
import Page3 from '../page/page3';
import Page4 from '../page/page4';
import Page5 from '../page/page5';
import Ionicons from 'react-native-vector-icons/FontAwesome';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
const DrawerNav = createDrawerNavigator({
Page4: {
screen: Page4,
navigationOptions: {
drawerLabel: 'Page4',
drawerIcon: ({tintColor}) => {
return <MaterialIcons
name='drafts'
size={24}
style={{
color: tintColor
}}
/>
},
drawerLockMode: 'unlocked'
}
},
Page5: {
screen: Page5,
navigationOptions: {
drawerLabel: 'Page5',
drawerIcon: ({tintColor}) => {
return <MaterialIcons
name='move-to-inbox'
size={24}
style={{
color: tintColor
}}
/>
},
drawerLockMode: 'unlocked'
}
}
},{
initialRouteName: 'Page4', // 初始路由
contentOptions: {
activeTintColor: '#e91e63'
},
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle',
contentComponent: (props) => (
<ScrollView
style={{backgroundColor: '#789', flex: 1}}
>
<SafeAreaView forceInset={{ top: 'always', horizontal: 'never' }}>
<DrawerItems {...props} />
</SafeAreaView>
</ScrollView>
)
})