在TabBar页面中打开页面

时间:2018-01-31 17:14:00

标签: reactjs react-native react-navigation react-native-router-flux

我的项目中有这些结构:

反应天然路由器通量



#APP
- TabBar
-- Page 1
--- Page 2
-- Page 3
-- Page 4




如何打开Page 2,INSIDE Page 1? (不修改选定的tabview图标)

我试试:

来自第1页的

Actions.Page2({}),但错误;

我的代码:



<Provider store={store}>
 <RouterWithRedux>
  <Scene key="root"
  drawer={true}
  contentComponent = {Menu}
  tabBarStyle={{backgroundColor: '#f00'}}
  >
   <Scene
   initial={true}
   key="rootTabBar"
   tabs={true}
   tabBarPosition={'bottom'}
   tabBarStyle={{backgroundColor: '#ffffff'}}>
   <Scene key="Page1" component={Page1} title="Page1" icon={TabIconx} initial>

    <Scene key="Page2" component={Page2} title="Page2" icon={TabIcon} />
   </Scene>

   <Scene key="Page3" component={Page3} title="Page3" icon={TabIcon} />

  </Scene>

    <Scene key="Page4" component={Page4} title="Page4"/>
   </Scene>
 </RouterWithRedux>
</Provider>
&#13;
&#13;
&#13;

韩国社交协会!

1 个答案:

答案 0 :(得分:0)

答案:

&#13;
&#13;
<Provider store={store}>
     <RouterWithRedux>
      <Scene key="root"
      drawer={true}
      contentComponent = {Menu}
      tabBarStyle={{backgroundColor: '#f00'}}
      >
       <Scene
       initial={true}
       key="rootTabBar"
       tabs={true}
       tabBarPosition={'bottom'}
       tabBarStyle={{backgroundColor: '#ffffff'}}>
       <Scene key="Page1" title="Page1" icon={TabIconx} initial>

        <Scene key="Page1" component={Page1} title="Page1" icon={TabIcon} initial/>
        <Scene key="Page2" component={Page2} title="Page2" icon={TabIcon} />
       </Scene>

       <Scene key="Page3" component={Page3} title="Page3" icon={TabIcon} />

      </Scene>

        <Scene key="Page4" component={Page4} title="Page4"/>
       </Scene>
     </RouterWithRedux>
    </Provider>
&#13;
&#13;
&#13;