David Hoerl
David Hoerl

Reputation: 41622

"scrollsToTop" not working even though only one UIScrollView subclass has "scrollToTop" set in view hierarchy

There are a slew of topics on this site with similar questions, but no matter what I do I cannot get scrollsToTop working in my app:

My view structure is complex - childViewControllers, custom headers, etc. I just cannot find any way to get this feature to work.

Upvotes: 0

Views: 98

Answers (1)

David Hoerl
David Hoerl

Reputation: 41622

Well, I have to give credit to a Q&A not on SO for the clue: most every other solution has suggested walking the view hierarchy from the current view down, but this author says to walk if from the window down.

When I did that, I found the culprit: the hidden master view in my UISplitViewController (the app's root view controller) has a table, and that table had scrollsToTop set to true.

I changed it to false, and voila - now I get a working scrollsToTop!

Upvotes: 0

Related Questions