【问题标题】:Open Page inside TabBar Page在 TabBar 页面中打开页面
【发布时间】:2018-01-31 17:14:00
【问题描述】:

我的项目中有这些结构:

react-native-router-flux

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

如何在第 1 页内打开第 2 页? (不修改选中的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>

谢谢!

【问题讨论】:

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


    【解决方案1】:

    答案:

    <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>

    【讨论】:

      猜你喜欢
      • 2021-10-09
      • 1970-01-01
      • 2011-06-06
      • 2019-12-28
      • 2017-12-03
      • 1970-01-01
      • 2011-05-17
      • 1970-01-01
      相关资源
      最近更新 更多