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

Trigger bounce/zoom on drag in header #61

Open
eddyjusufi opened this issue Feb 27, 2019 · 3 comments
Open

Trigger bounce/zoom on drag in header #61

eddyjusufi opened this issue Feb 27, 2019 · 3 comments

Comments

@eddyjusufi
Copy link

Is there a way to trigger the bounce/zoom when the user scrolls down by touching the header as well?

@Nhacsam
Copy link
Contributor

Nhacsam commented Mar 12, 2019

It should be if you have no foreground : #6 (comment)
Can I see your code ?

@eddyjusufi
Copy link
Author

@Nhacsam I do have text as foreground. Is there any way to trigger the header bounce/zoom through it nonetheless? Here is what my code looks like:

<HeaderImageScrollView
       maxHeight={MAX_HEIGHT}
       minHeight={MIN_HEIGHT}
       minOverlayOpacity={0}
       maxOverlayOpacity={0}
       headerImage={require("../../../assets/images/headerImage.jpg")}
       renderForeground={() => (
                    <View style={{ flex: 1, flexDirection: 'row', alignSelf: "flex-end", alignItems: "flex-end" }} >
                      <TouchableOpacity onPress={() => console.log("tap!!")}>
                        <Text style={{ color: "white", backgroundColor: "transparent", alignSelf: "center" }}>Really long text with a link when pressed</Text>
                      </TouchableOpacity>
                    </View>
                  )}
                >
      <View style={{ flex: 1, height: 1000 }}>
            <TriggeringView onHide={() => console.log("text hidden")}>
                   <Text>Scroll Me!</Text>
             </TriggeringView>
       </View>
     </HeaderImageScrollView>

@Nhacsam
Copy link
Contributor

Nhacsam commented Mar 22, 2019

No, you can't right now, The foreground intercept the touch event and don't propagate it to the scrollView behind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants