react native - Animate opacity based on view's position in scrollview -


i'm using react-native-swiper component allow user swipe horizontally between different listviews. animate opacity of these listviews @ full opacity when centered on screen , fade out when swiped left or right. have tried use onscroll event of parent scrollview (the swiper component) , using rctuimanager on listview components current position on screen:

var handle = react.findnodehandle(this.refs['list']); rctuimanager.measure(handle, (x, y, width, height, pagex, pagey) 

but resulting animation really choppy , i'm guessing because uses onscroll event update opacity value.

what best way achieve this?

probably not relevant anymore since old question can use usenativedriver: true on scrollview , animate opacity based on scroll event performance.

this blog post explains well


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -