Reputation: 311
I want to create next structure for my app settings screen header:
|<- Settings |
|-----------------|
| Tab 1 | Tab 2 |
|-----------------|
| |
| Active tab |
| content |
| |
| |
I tried to do that:
<Provider store={store}>
<RouterWithRedux>
<Scene key="root">
<Scene key="landing" component={Landing} title="Landing" initial={true} />
<Scene tabs key="rootTabBar" back wrap={false} title="Settings">
<Scene key="home" component={Home} title="Home" icon={TabIcon} initial />
<Scene key="search" component={Search} title="Search" icon={TabIcon} />
</Scene>
</Scene>
</RouterWithRedux>
</Provider>
but I get not what I expected, on attached screen is wrong tabs names
Upvotes: 2
Views: 3023
Reputation: 35
Try this.
import {Router, Scene} from 'react-native-router-flux';
import Home from './screens/Home';
import Post from './screens/Post';
import Forum from './screens/Forum';
const Routes = () => (
<Router>
<Scene key = "root">
<Scene key = "main"
tabs={true}
hideNavBar={true}
tabBarStyle={styles.navigationTabBar}
hideBackImage={true}>
<Scene key = "home" component = {Home} title = "Home" initial={true} hideNavBar = {true}/>
<Scene key = "post" component = {Post} title = "Post" hideNavBar = {true} />
<Scene key = "forum" component = {Forum} title = "Forum" hideNavBar = {true} />
</Scene>
</Scene>
</Router>
)
export default Routes
Got clue from http://pythonic.ninja/how-to-navigate-to-nested-tab-using-react-native-router-flux.html`
Upvotes: 1
Reputation: 46
This code worked for me
<Scene key="root" hideNavBar headerStyle={{ marginTop:STATUSBAR_HEIGHT, elevation:0}} >
<Scene key="main" hideNavBar >
<Scene key="newsList"
tabs={true}
hideNavBar={false}
headerMode='none'
navBar={Header}
wrap={false}
>
<Scene key="TehcList" component={TehcList} title="Teknoloji" />
<Scene key="GameList" component={GameList} title="Oyun" />
</Scene>
</Scene>
</Scene>
Upvotes: 2