6

I have a FlatList with a Header. When I pull to refresh now, the header goes down along with all list items: enter image description here

But I want it to stay on top, so that only items are pulled down:

enter image description here

Such behaviour can be achieved if I'd put my header component not inside the FlatList, but before it. However, it's not suitable as the header will always stay on top, but I need it to scroll away with list items as if it was the part of the list. How can I do that?

I have tried setting a negative margin for the header in the onScroll event, but it doesn't look smooth at all and causes weird effects.

I'd appreciate your ideas on how this can be done.

1
  • Have you find the answer ?
    – filo
    Apr 22, 2021 at 20:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.