【问题标题】:v2 Wix React-native-navigation: how to actually implement side Menu with bottomTabs?v2 Wix React-native-navigation:如何用 bottomTabs 实际实现侧边菜单?
【发布时间】:2019-04-09 13:42:20
【问题描述】:

我在将 sideMenu 实现到以下代码时遇到了一些麻烦:(请参阅 startTabs)。

我在我的根屏幕上单击“登录”后调用它。根屏幕如下所示:

Navigation.setRoot({
  root: {
    stack: {
      children: [{
        component: {
          name: "navigation.playground.WelcomeScreen",
          passProps: {
            text: "stack with one child"
          },
          alignment: "center",
          options: {
            topBar: {
              visible: true,
              title: {
                text: "main screen"
              }
            }
          }
        }
      }]
    }
  }
});

const startTabs = () => {
  Promise.all([
    Icon.getImageSource("md-map", 30),
    Icon.getImageSource("ios-share-alt", 30)
  ]).then(sources => {
    Navigation.setRoot({
      root: {
        bottomTabs: {
          children: [{
              stack: {
                children: [{
                    component: {
                      name: "navigation.playground.FindPlaceScreen",
                      options: {
                        bottomTab: {
                          text: "Find Place",
                          icon: sources[0]
                        },
                        topBar: {
                          visible: true,
                          title: {
                            text: "Find Place"
                          }
                        }
                      }
                    }
                  }

                ]
              }
            },
            {
              stack: {
                children: [{
                  component: {
                    name: "navigation.playground.SharePlaceScreen",
                    options: {
                      bottomTab: {
                        text: "Share Place",
                        icon: sources[1]
                      },
                      topBar: {
                        // visible: true,
                        title: {
                          text: "Share Place"
                        }
                      }
                    }
                  }
                }]
              }
            }
          ]
        }
      }
    });
  });
};

现在为了让我在登录后实现sideMenu,我会在“startTabs”中实现它吗?或其他地方?

【问题讨论】:

    标签: javascript react-native react-native-navigation wix-react-native-navigation react-native-navigation-v2


    【解决方案1】:

    解决了这个问题。抱歉,我是一名新程序员,所以我的 sideDrawer 组件中有一个拼写错误,其中“render”拼写为“redner”。花了我最长时间才弄明白的!!!

    否则我在最初的问题中粘贴的代码是正确的(供任何查看此以供参考的人)。谢谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-03
      • 2017-08-02
      • 1970-01-01
      • 1970-01-01
      • 2019-10-22
      • 1970-01-01
      • 2017-10-22
      相关资源
      最近更新 更多