简体   繁体   中英

iPhone UITableView scrolling same time

I have 2 table view, with the same number of cells. Could you please point me the correct way, that I could implement simultaneous scrolling. I mean, when I scroll through one table, the other one is scrolling the same time. Thanks.

As uitable view is derived from uiscrollview you can get the scroll amounts in the delegate method

- (void)scrollViewDidScroll:(UIScrollView *)scrollView 

You can get content offset of the scrollview which is being scrolled and assign that to the other tableview.

In this method you should be able to access both tableviews.

The property you need to check is contentOffset .

firsttableview.contentOffset = scrollview.contentOffset

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM