Working with two UITables in a view: how to auto scroll one when the other is scrolled by the user?

StackOverflow https://stackoverflow.com/questions/19198336

  •  30-06-2022
  •  | 
  •  

سؤال

So this is the situation:

I will have 2 differente UITables in the same controller. So, i want to work with a classic vertical UITable controlled by the user who scrolls up and down as demanded. Meanwhile, in the same view I want to have a second UITable with horizontal layout.

Is it possible to auto scroll the horizontal table at the same time when the user scrolls with his finger the vertical UITable?

هل كانت مفيدة؟

المحلول

UITableView extends UIScrollView. Implement the appropriate scroll view delegate methods to be notified of changes to the content offset of the table view. Based on the updated value of the table you can update the content offset of the other table.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top