How to create a custom collapsible header in React Native?

。_饼干妹妹 提交于 2019-12-10 14:57:00

问题


Below is a demo screen of what I want to implement.

So, what I want to do is that when I swipe up on the green area, I want the yellow area to move up along with it, and also the below blue box area (which is FlatList in my case).

When the yellow area is finally hidden, I want the green area to stick at the top of the screen and the user can scroll in the below blue box area.

How can I do it with PanResponder and Animated API? As far as I know, it can be done using Interpolation but I'm not able to get the logic in this case.

来源:https://stackoverflow.com/questions/55021560/how-to-create-a-custom-collapsible-header-in-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!