-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lost Scroll Position? #3
Comments
It sounds like a great idea, but I think it's somewhat outside of the scope of the tool. It can be easily achieved though: |
I have. Currently I have settled on manually setting the offset of the table view after I've calculated the height of everything that is being added. However that isn't the most elegant solution as I can't animate visible deletions and sometimes the table still flashes when things get reloaded. That's why when I saw "lost scroll position" as one of the listed problems this tool was supposed to solve I got really excited, but I suppose you meant something else. |
Well, what I meant is that you see changes animating in, therefore user understands changes better than simply new cells appearing out of nowhere, but I understand your point, it does sound like a nice addition. Do you have an idea of how this API would look? |
Couple of additional question, as it seems like you gave this problem some though already 😃
|
So 'UITableView' has an API called
Where everything stays the same except the anchor would refer to a visible cell index returned from the above mentioned table view API. In the event that all visible cells are actually being removed, the anchor would be the first cell above the removed cells that isn't being removed. In the event that there is no cell above the removed cells, there would be no anchor. I haven't thought through all the possible edge cases as I've really only thought about something like this in the context of my own use cases, but I think this adequately covers the most immediate cases. What do you think? |
So, as I understood, you'd prefer to maintain the original offset from the top of the |
Yes that is correct. You're also correct that there is no callback or any sort of completion handler, so I do think a timer is the best solution for this. Or maybe something could be done with |
Ok, I'll think of a way to deal with it and will try to work something out when I have time. |
Thanks! I'll definitely be taking a good long look at it as well, as it is an integral part of a project I'm currently working on. Best of luck! |
This utility lists "lost scroll position?" as one of the problems it solves. Am I correct in assuming that there is an ability to insert rows without losing scroll position? If not, is it possible to add this ability by, for example, setting an anchor cell or index that stays while everything mutates around it?
The text was updated successfully, but these errors were encountered: