react-navigation一个右对齐的抽屉标签

时间:2018-06-30 17:11:37

标签: react-native react-navigation

我正在研究App,并添加了createDrawerNavigator,但是drawerPosition: 'right',仍然在左边。
如何将DrawerNavigator的内容正确对齐?

drawerLabel: 'Home'

我需要此输出:
Photo

1 个答案:

答案 0 :(得分:0)

已解决✅。

 const DrawerStack = createDrawerNavigator(
  {
    Home: {
      screen: Screen1Stack
    },
    About: {
      screen: Screen2Stack,
    },
  },
  {
    initialRouteName: 'Home',
    contentOptions: {
      activeTintColor: '#e91e63',
      itemsContainerStyle: {
        // opacity: 1
      },
      iconContainerStyle: {
        // opacity: 1
      },
      itemStyle: {
        flexDirection: 'row-reverse'
      }
    },
    drawerWidth: 300,
    drawerPosition: 'right'
  }
);