Giter Club home page Giter Club logo

Comments (11)

Nhacsam avatar Nhacsam commented on August 22, 2024 1

I tried to work on that issue today, but with no success. I guess I need help to find a solution.

The following schemas represent the current implementation of the module after a small scroll.

With overflow Without overflow
capture d ecran 2017-08-06 a 17 42 17 capture d ecran 2017-08-06 a 17 42 45

The legend :

  • Red : The header container. It has absolute position on top and fixed height. Above it, the image and the overlay
  • Blue: The fixed foreground. It stay on top too but it is above the overlay
  • Black: The scrollView container
  • Green: The scrollView. The scroll view is above the header. It go down a bit when you scroll to let some space to the navbar.
  • Pink: The scrollView content. I added a transformY to be able to see the image behind.
  • Orange: The Touchable fixed foreground. Same implementation than the old header
  • Yellow: The foreground. It scroll top with the scrollView

As you see, the scrollVIew is above the header and the fixed foreground. That's why we can't press on it. The scrollView take the event from the Responder system.

If you want to see the code with the color : #21

In the previous implementation, the header was above the scrollView (same legend)

With overflow Without overflow
capture d ecran 2017-08-06 a 17 13 26 capture d ecran 2017-08-06 a 17 15 04

I reduce the height of the header container (in red) on scroll. The header container have an overflow: hidden. The image and the fixed foreground are placed with absolute positioning inside and are cropped when the container height reduce (like you suggested @tychota)
The code is here : #20 (with the colors: #19)

Everything stay touchable but it is very laggy. I guess it is related to the image rerendering or too much time between the ScrollView event.

demo
(This is a 60FPS gif)

@tychota @Almouro @yleflour @4ian Anyone of you have an Idea on what I can do ?

from react-native-image-header-scroll-view.

Nhacsam avatar Nhacsam commented on August 22, 2024 1

Unfortunately no. Still have no solution for this :/

from react-native-image-header-scroll-view.

Nhacsam avatar Nhacsam commented on August 22, 2024

Hello,
Thanks for reporting me your issue.

Unfortunately, I don't know how to fix your problem.
To fix performance issues on Android, I put the ScrollView above the fixedForeground. So, when you try to tap your button, your are touching the ScollView instead.

I haven't any idea of implementation which is good on android and allow you to set Touchable in the fixedForeground.

Nevertheless, I changed the foreground to be rendered above the scrollView in the 0.5.0 version. So, if it's possible for you, you can add your button in the renderForeground method.

from react-native-image-header-scroll-view.

Silvercast avatar Silvercast commented on August 22, 2024

+1

from react-native-image-header-scroll-view.

denghejun avatar denghejun commented on August 22, 2024

+1
It will be a perfect component if we can fix the issue. After all, we need render some touchable button or something like that to interact with user. Absolutely that will be cool.

from react-native-image-header-scroll-view.

Nhacsam avatar Nhacsam commented on August 22, 2024

I added a method renderTouchableFixedForeground which use the old implementation in the v0.6.0
So you can use it to render a FixedForeground which accept Touchable.

But like I said, there is very bad perf on Android.
Every ideas to improve that are welcome.

demo|demo

from react-native-image-header-scroll-view.

denghejun avatar denghejun commented on August 22, 2024

But after I upgrade to V0.6.0 and use the renderTouchableFixedForeground, it works for fixed foreground, but the renderForeground can NOT be touchable any more!
Did I miss something?

from react-native-image-header-scroll-view.

Nhacsam avatar Nhacsam commented on August 22, 2024

The Basic usage example still works for me. Can I see your code ?

from react-native-image-header-scroll-view.

tychota avatar tychota commented on August 22, 2024

Cc @brentvatne, do you have any idea? We spoke about those kind of animation a while ago and you told me of a bug in RN and a way to bypass it.

from react-native-image-header-scroll-view.

Nhacsam avatar Nhacsam commented on August 22, 2024

I maybe gonna try a new implementation with https://github.com/cesardeazevedo/react-native-nested-scroll-view but i will add a native dependency

from react-native-image-header-scroll-view.

FilipeAraujo avatar FilipeAraujo commented on August 22, 2024

@Nhacsam any news about this issue? thanks!

from react-native-image-header-scroll-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.