Giter Site home page Giter Site logo

Comments (10)

PedroBern avatar PedroBern commented on May 2, 2024

Hi @kiwina can you share some code or a screenshot?

from react-native-collapsible-tab-view.

PentamapRainer avatar PentamapRainer commented on May 2, 2024

Same here: How is it possible to set a minimum height of the remaining collapsible header so that there can be shown an ActionBar? It should look similar to that:

Simulator Screen Shot - iPhone 11 - 2021-01-07 at 13 58 28

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

Hi @PentamapRainer you can render the toolbar above the CollapsibleTabView and pass the same Animated.Value to both (<CollapsibleTabView animatedValue={scrollY} ... />)

I have a setup like this where I'm using a react-navigation header and animating the title when the user is scrolling.

from react-native-collapsible-tab-view.

PentamapRainer avatar PentamapRainer commented on May 2, 2024

When I try to render the toolbar above the CollapsibleTabView with following code, then the CollapsibleTabView is not shown any more. Just the Text element is shown.

<View>
    <Text>HERE COMES THE NAVIGATIONBAR</Text>        
    <CollapsibleTabView<Route>
        navigationState={{ index, routes }}
        renderScene={renderScene}
        onIndexChange={handleIndexChange}
        renderHeader={renderHeader}
        headerHeight={HEADER_HEIGHT}
        tabBarHeight={150}
        {...props}
    />
</View>

So where do I have to render the NavigationBar above the CollapsibleTabView?

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

Did you try flex: 1?

from react-native-collapsible-tab-view.

PentamapRainer avatar PentamapRainer commented on May 2, 2024

Did you try flex: 1?

Thanks a lot! That worked:

<View style={{flex:1}}>
    <Text>HERE COMES THE NAVIGATIONBAR</Text>
    <CollapsibleTabView<Route>
        navigationState={{ index, routes }}
        renderScene={renderScene}
        onIndexChange={handleIndexChange}
        renderHeader={renderHeader}
        headerHeight={HEADER_HEIGHT}
        tabBarHeight={150}
        {...props}
    />
</View>

from react-native-collapsible-tab-view.

PentamapRainer avatar PentamapRainer commented on May 2, 2024

One more question to this issue: Is it possible to make the collapsible header behind the (transparent) NavigationBar, so that the header image is visible behind the NavigtionBar when scrolling to the top.

This is how it looks now:

Simulator Screen Shot - iPhone 11 - 2021-01-08 at 09 25 50

This is how the header should look like:

Simulator Screen Shot - iPhone 11 - 2021-01-08 at 09 29 54

from react-native-collapsible-tab-view.

tcorreiaubi avatar tcorreiaubi commented on May 2, 2024

@PentamapRainer If I got your question right, you can interpolate the opacity of the "bar", to do so, you can use the animated value coming from the CollapsibleTabView and interpolate it between 0 and the header height to get the opacity, something like

  const backgroundOpacity = scrollYPosition.interpolate({
    inputRange: [0, scrollSize],
    outputRange: [0, 1],
    extrapolate: 'clamp',
  });

from react-native-collapsible-tab-view.

tcorreiaubi avatar tcorreiaubi commented on May 2, 2024

@PedroBern Is it possible to configure a minimum header height with the v3 version? While the approach of placing the component outside the Collapsible tab view component is an easy and simple approach, if you need to place the content with an absolute position on the header(something similar to the previous image on the comments), it becomes really hard to come with a solution since the absolute position removes the component from the screen flow and its size is not taken into consideration.
This is more of a discussion other than an "issue" for me, wasn't just sure how to reach you to discuss it, thanks in advance.

from react-native-collapsible-tab-view.

PedroBern avatar PedroBern commented on May 2, 2024

@tcorreiaubi no, it's still not possible in v3, I know, this desired configuration is probably hard to get with the current implementation, but it's open for PR.

from react-native-collapsible-tab-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.