Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native CreateNavigationDrawer右侧反应本机_React Native_Navigation Drawer_React Navigation - Fatal编程技术网

React native CreateNavigationDrawer右侧反应本机

React native CreateNavigationDrawer右侧反应本机,react-native,navigation-drawer,react-navigation,React Native,Navigation Drawer,React Navigation,如何使导航抽屉在幻灯片的右侧,我尝试了位置:对,但它不工作 export default createDrawerNavigator({ Home:{ screen: AppStackNav, navigationOptions: { drawerIcon: ({tintColor}) => ( <Icon name = 'ios-home' style={{fontSize:24, color: tintColor}}/> ), drawerLa

如何使导航抽屉在幻灯片的右侧,我尝试了位置:对,但它不工作

 export default createDrawerNavigator({

 Home:{
 screen: AppStackNav,
 navigationOptions: {
  drawerIcon: ({tintColor}) => (
    <Icon name = 'ios-home' style={{fontSize:24, color: tintColor}}/>
  ),
  drawerLabel: "Home",

}},

Setting: {
screen: SettingScreen,
navigationOptions: {
    drawerLabel: "Setting",
    drawerIcon: ({tintColor}) => (
      <Icon name = 'ios-settings' style={{fontSize:24, color: tintColor}}/>
    )}},
{
    contentComponent: CustomDrawerComponent

  },{
   drawerPosition: 'right',}

);
导出默认createDrawerNavigator({
主页:{
屏幕:AppStackNav,
导航选项:{
抽屉图标:({tintColor})=>(
),
抽屉标签:“家”,
}},
设置:{
屏幕:设置屏幕,
导航选项:{
抽屉标签:“设置”,
抽屉图标:({tintColor})=>(
)}},
{
contentComponent:CustomDrawerComponent
},{
抽屉位置:'右',}
);

缺少组件的收尾括号,抽屉位置应该是组件收尾括号后的第一个参数。现在可以正常工作

const Hello = createDrawerNavigator({
     Home:{
     screen: AppStackNav,
     navigationOptions: {
      drawerIcon: ({tintColor}) => (
        <Icon name = 'ios-home' style={{fontSize:24, color: tintColor}}/>
      ),
      drawerLabel: "Home",

    }},

    Setting: {
    screen: SettingScreen,
    navigationOptions: {
        drawerLabel: "Setting",
        drawerIcon: ({tintColor}) => (
          <Icon name = 'ios-settings' style={{fontSize:24, color: tintColor}}/>
        )}}
      },{
       drawerPosition: 'right',},
    {
        contentComponent: CustomDrawerComponent

      }

    );
const Hello=createDrawerNavigator({
主页:{
屏幕:AppStackNav,
导航选项:{
抽屉图标:({tintColor})=>(
),
抽屉标签:“家”,
}},
设置:{
屏幕:设置屏幕,
导航选项:{
抽屉标签:“设置”,
抽屉图标:({tintColor})=>(
)}}
},{
抽屉位置:'右',},
{
contentComponent:CustomDrawerComponent
}
);
React导航v5

import {createDrawerNavigator} from '@react-navigation/drawer';
const Drawer = createDrawerNavigator();
然后是抽屉,导航器

抽屉位置=“右”

像这样

   <Drawer.Navigator
      drawerPosition="right"
      initialRouteName="Home">
      <Drawer.Screen name="Home" component={HomeScreen} />
   </Drawer.Navigator>

为了给您一个很好的答案,如果您还没有浏览一下,它可能会对我们有所帮助。如果您能够提供一个。