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

Is posibble scroll-on-tab-item like scroll-on-header ? #140

Open
sanduluca opened this issue Feb 18, 2021 · 6 comments
Open

Is posibble scroll-on-tab-item like scroll-on-header ? #140

sanduluca opened this issue Feb 18, 2021 · 6 comments
Labels
question Further information is requested

Comments

@sanduluca
Copy link

I read scroll-on-header block and want to say that this is a great possibility, but I want to ask if there is a way to make possible scroll-on-tab-item ?
I am looking forward of creating an exact experience like Instagram profile screen(a Header, few tabs, very smooth and great scroll experience)
This package definitely deserves more stars, for functionality it provides right now.

@sanduluca sanduluca added the question Further information is requested label Feb 18, 2021
@sanduluca sanduluca changed the title Is posibble scroll on tab like scroll-on-header ? Is posibble scroll-on-tab-item like scroll-on-header ? Feb 18, 2021
@PedroBern
Copy link
Owner

Hi @sanduluca maybe it's possible with touchables from the gesture-handler, you will need to build your own tab bar. Please if you do, share it here, it's a nice feature.

@sanduluca
Copy link
Author

Hi @sanduluca maybe it's possible with touchables from the gesture-handler, you will need to build your own tab bar. Please if you do, share it here, it's a nice feature.

Thanks for your reply. Definitely will try to implement it and will come back with a merge request.

@alexpchin
Copy link
Contributor

alexpchin commented Feb 24, 2021

@sanduluca I have almost implemented this in my project. This issue is also related slightly to #122

I feel like this could be implemented potentially similar to https://github.com/PedroBern/react-native-collapsible-tab-view/blob/main/example/src/Shared/ExampleComponentSharedPullToRefresh.tsx and not including a HeaderComponent in Tabs.Container but instead in the outer scroll component?

This "almost" would work:

<FlatList
  data={[0]}
  keyExtractor={_keyExtractor}
  ListHeaderComponent={_renderHeader}
  nestedScrollEnabled
  ref={pageRef}
  refreshControl={
    <RefreshControl onRefresh={onRefresh} refreshing={isFetching} />
  }
  renderItem={() => (
    <Tabs.Container
      headerContainerStyle={TabBarStyle.headerContainerStyle}
      lazy
      pagerProps={{
        showsVerticalScrollIndicator: false,
      }}
      snapThreshold={0.5}
      TabBarComponent={_renderTabBar}
    >
    {tabs.map((tab) => (
       <Tabs.Tab key={tab.name} label={tab.label} name={tab.name}>
         {tab.component}
       </Tabs.Tab>
     ))}
    </Tabs.Container>
  )}
  scrollEventThrottle={16}
  showsHorizontalScrollIndicator={false}
  showsVerticalScrollIndicator={false}
/>

@kormocicsaba
Copy link

kormocicsaba commented Aug 17, 2023

any updates on this? @PedroBern @alexpchin @sanduluca

@senghuotlay
Copy link

I would like to be able to wrap a pangesturehandler for the TabBar, therefore i would be able to scroll detect on scrollY, it should scroll the pagerView. However, it seems like the tabbarprops wouldn't allow that

@kormocicsaba
Copy link

I would like to be able to wrap a pangesturehandler for the TabBar, therefore i would be able to scroll detect on scrollY, it should scroll the pagerView. However, it seems like the tabbarprops wouldn't allow that

So what would be the solution then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants