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

More tab for ios tabbarbottom. #2659

Closed
rabrenio opened this issue Sep 28, 2017 · 6 comments
Closed

More tab for ios tabbarbottom. #2659

rabrenio opened this issue Sep 28, 2017 · 6 comments

Comments

@rabrenio
Copy link

rabrenio commented Sep 28, 2017

As described here, a tab bar may contain any number of tabs, but the number of visible tabs varies based on the device size and orientation. If some tabs can’t be displayed due to limited horizontal space, the final visible tab becomes a More tab, which reveals the additional tabs in a list on a separate screen. I think this feature is needed, it is the default behavior for ios tabbar.

@JulianKingman
Copy link

I believe what you're looking for is attaching an action to a button (such as pressing "more" which opens a DrawerNavigator). This can currently be done with tabBarComponent (as below), but there are several open issues asking for custom actions, so check out those for further info (several referenced here: #1335)

const TavNav = TabNavigator(
  {
    Home: {screen: Home},
    One: {screen: One},
    Two: {screen: Two},
    More: {screen: more},
  },
  {
    tabBarComponent({jumpToIndex, navigation, ...props}) {
      return (
        <TabBarBottom
          {...props}
          navigation={navigation}
          jumpToIndex={(index) => {
            if (index === 3) {
              // or whatever index your menu button is
              navigation.navigate('DrawerOpen');
            } else {
              jumpToIndex(index);
            }
          }}
        />
      );
    },
  },
);

@rabrenio
Copy link
Author

rabrenio commented Oct 2, 2017

@JulianKingman thanks for the response.. Hmmm I don't want a drawer, but I suppose I can create a custom more tab using your solution. It would be great if this would be added as a default feature for this is the default behavior of ios tabbar.

@rabrenio
Copy link
Author

rabrenio commented Oct 6, 2017

@matthamil I have updated the info, thanks.

@kelset
Copy link

kelset commented Dec 17, 2017

Pinging OP @rabrenio since this issue has not been active for a while, and it's related to an old version of the lib.

Please let me know if you want this to remain open (does it still happen in the latest version?); if I get no answer in the next 7 days I will close it.

@rabrenio
Copy link
Author

Hello @kelset , I still need this ticket open until this feature is added. I would really love this feature, thanks in advance 👍

@brentvatne
Copy link
Member

please re-post to https://react-navigation.canny.io/feature-requests if this is important for you. re-organizing issues to focus on bug reports here and feature requests on canny. thanks!

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

6 participants