You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think you could simply implement scrollViewDidScroll: delegate method and check if the header's frame origin is in (0,0). That would be exactly when the header gets sticked.
In my case, the first section does not have a header. So no header will get to (0,0). However, i can check if scrollview.contentOffset is inside header.frame. Actually, I noticed this is not always exact either so I did something like:
if (CGRectContainsPoint(header.frame, CGPointMake(scrollView.contentOffset.x, scrollView.contentOffset.y + header.frame.size.height/2)))
I have more than 20 different section. Going through all the headers every time scrollViewDidScroll gets called and checking their frames seems overkill.
I was looking for a way to add a new delegate method to inform me when a header (ideally which header also) became sticky.
Seems like a nice feature to me. We would be happy to implement it, but we are very busy these weeks. If you don't mind to wait, we could add this at the end of the month/beginning of the next one...
But we are happy to receive pull requests. So if you want to add it yourself and send us a PR, it would be awesome 😄
Hi. Is there a way to find out when a header became sticky?
I would like to add a drop shadow to the header when it becomes sticky.
Thanks
The text was updated successfully, but these errors were encountered: