AnimatingTableViewHeader icon indicating copy to clipboard operation
AnimatingTableViewHeader copied to clipboard

Header late to expand upon scroll up when table view has bottom layout margins or content inset

Open tfe opened this issue 3 years ago • 0 comments

Thanks so much for this code and blog post; so useful!

I noticed an odd behavior where when I'd scroll up from the bottom, the header would be late to un-collapse... I'd have to get a couple cells up from the bottom before it started to un-collapse.

In my case I'm using this technique on a collection view appearing inside a UITabBarController, where the collection view scrolls under the bottom bar.

It occurred to me the amount I was needing to scroll up before triggering the uncollapse was roughly the height of the bottom bar. I realized that the calculation of absoluteBottom probably needs to take this extra space into account.

After accounting for the layout margins (and content inset, same issue) in the absoluteBottom calculation, the un-collapse is now pixel-perfect!

I'll have a PR for you in a second to account for it on this project too. But I wanted to document this in an issue in case someone else was running into the same problem.

tfe avatar Jun 10 '21 07:06 tfe