Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to hide the icon from the tab bar of selected scenes #2980

Closed
smhassan90 opened this issue Apr 3, 2018 · 7 comments
Closed

how to hide the icon from the tab bar of selected scenes #2980

smhassan90 opened this issue Apr 3, 2018 · 7 comments

Comments

@smhassan90
Copy link

smhassan90 commented Apr 3, 2018

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0 (v3 is not supported)
  • react-native v0.53.3
<Router navBar = {navBar}>
          <Scene key="root">
            <Scene key="LoginScreen" initial component={LoginScreen} hideNavBar />
            <Tabs key="tabs" tabBarStyle={styles.tabBarStyling}  hideNavBar tabBarPosition='bottom'  showLabel={false} swipeEnabled={false} lazy={true} backBehavior={'initialRoute'}>
              <Scene key="BiographyScreen"  hideNavBar title="Biography" icon={TabIcon}  component={BiographyScreen}/>
              <Scene key="EventLocation" hideNavBar title="EventLocation" icon={TabIcon} component={EventLocation}/>
              <Scene key="EventStream"  hideNavBar title="EventStream" icon={TabIcon} component={EventStream} />
              <Scene key="Settings" hideNavBar title="Settings" icon={TabIcon} component={Settings} />
              <Scene key="MenuList"  hideNavBar component={MenuList}/>
              <Scene key="TableList" hideNavBar component={TableList} />
            </Tabs>
          </Scene>
        </Router>

Expected behaviour

I want to hide icons of MenuList and TableList from tab bar, but want to show tab bar while user is on that scene.

Actual behaviour

It is not showing the icon but it is showing the empty space.

@eyexx
Copy link

eyexx commented Jul 15, 2018

Me, too !😭

@eyexx
Copy link

eyexx commented Jul 15, 2018

Does anyone know how to fix this???

@smhassan90
Copy link
Author

I fixed it by making it a child of some scene. Let me know if you need more clarification.

@eyexx
Copy link

eyexx commented Jul 18, 2018

@smhassan90
Thanks, I was able to resolve!

@smhassan90
Copy link
Author

How did you resolve? I want to know if there is some good work around

@eyexx
Copy link

eyexx commented Jul 19, 2018

<Scene>
               <Tabs key="main" style={{ backgroundColor: '#003366' }}
               >
                   <Scene
                       title = "Write"
                       key="writemessages"
                       component={WriteMessages}
                   />
                   <Scene                     
                       rightTitle="Yours"
                       title="Ranking"
                       key="showmessages"
                       component={ShowMessages}                 
                   />

                   <Scene
                       title="MyPage"
                       key="mypage"
                       component={MyPage}
                       direction='vertical'                     
                   />

               </Tabs>
               </Scene>
               <Scene key="sub">
               <Scene
                   title = "Yours"
                   key="showyourmessages"
                   component={ShowYourMessages}
               />
                <Scene
                    title = "Details"
                    key="showdetails"
                    component={ShowDetails}            
                />
               <Scene
                   title = "MyMap"
                   key="showmymap"
                   component={MypageMap}
                  
               />
           </Scene>

I did like this. i made another scene which does not have tag element and I put what i do not wanna show tabs there.

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Closing because of correct solution, thanks @Koshukey

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants