Reputation: 161
I have several UITableViews embedded in a ScrollView. The ScrollView scrolls from left to right or right to left, and the UITableView can scroll up and down. You scroll left or right to change tableview displayed to you. I turned off scrollToTop property in ScrollView and want that work in each of the UITableView.
However, I'm only able to turn on one of scrollToTop property in one table and the rest of table still won't scroll to top if you click on the status bar. If I turn scrollToTop on for each table in the ScrollView, then none of them would work. Is there a way to make all of the table work?
Upvotes: 0
Views: 377
Reputation: 386018
Special Considerations
On iPhone, the scroll-to-top gesture has no effect if there is more than one scroll view on-screen that hasscrollsToTop
set toYES
.
If you're only letting one table view appear on the screen at a time, then you can set scrollToTop
to YES
for that table view and to NO
for the others.
Another approach is to let scrollToTop
set to YES
for just the first table view, and set to NO
for all the others. Then in the first table view's delegate, override scrollViewShouldScrollToTop:
to return NO
and to tell all the table views to scroll to the top using setContentOffset:animated:
.
Upvotes: 1