React Native Router Flux Tabbar未显示

时间:2017-04-23 09:26:37

标签: react-native tabbar react-native-router-flux

我正在尝试将Tabbar添加到我的项目中,但它无法正常工作。我只希望Tabbar显示在我的homeScreen.js场景中,并且我想要一个用于打开我的discoverScreen.js的标签栏,我将如何更改我的代码才能使其正常工作?

    render(){

return (
  <Router>
    <Scene key="root">

    <Scene
      key="tabbar"
      tabs
      tabBarStyle={{ backgroundColor: '#FFFFFF' }}
      >
        <Scene key="Discover" title="Discover" icon={TabIcon}>
          <Scene key="discoverScreen"
            component={DiscoverScreen}
            title="DiscoverScreen"
            initial
          />
        </Scene>
      </Scene>

    <Scene key="login"
      component={LoginView}
      title="Login"
      direction="vertical"
      hideNavBar
      />
    <Scene key="register"
      component={Register}
      title="Register"
      direction="vertical"
      hideNavBar
      />

    <Scene key="firstScreen"
    component={FirstScreen}
    title="FirstScreen"
    direction="vertical"
    hideNavBar
    initial
    />
    <Scene key="discoverScreen"
      component={DiscoverScreen}
      title="DiscoverScreen"
      direction="vertical"
      type="reset"
      />
    <Scene key="loginScreen"
      component={LoginScreen}
      title="LoginScreen"
      direction="vertical"
      hideNavBar
      />
      <Scene key="homeScreen"
        component={HomeScreen}
        title="HomeScreen"
        />


    </Scene>
  </Router>
);

} }

感谢任何帮助!

0 个答案:

没有答案