v2 Wix React-native-navigation:如何用bottomTab实际实现侧面菜单?

问题描述 投票:0回答:1

我在实现以下代码的侧面菜单时遇到了一些麻烦:(参见星标签)。

我在根屏幕上点击“登录”后调用此方法。根屏幕如下所示:

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个回答
0
投票

解决了这个问题。对不起,我是一个新的程序员,所以我的sideDrawer组件中有一个拼写错误,其中“render”拼写为“redner”。花了我最长的时间来解决这个问题!

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

© www.soinside.com 2019 - 2024. All rights reserved.