Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView auto-scrolls simultaneously according to another UITableView
    primarykey
    data
    text
    <p>Is it possible to make the effect that :</p> <p>when I scroll an UITableView, another UITableView auto-scrolls simultaneously according to the UITableView I am moving.</p> <p>NS: Can't combine the two UITableViews in one UITableView for some reasons...</p> <p>Thanks.</p> <hr> <p>I have found a way and tested. Just I am not sure if it is a good way. Perform scrollViewDidScroll of UIScrollViewDelegate like the follows. But I have to uncheck bouncing effect since it makes the scrollViewDidScroll being called for many times for one scroll...</p> <pre><code>- (void)syncTableViews:(UIScrollView *)whatScrollView { int tmpDesY = whatScrollView.contentOffset.y; BOOL tmpNeedSetTv00 = NO; BOOL tmpNeedSetTv01 = NO; BOOL tmpNeedSetTv02 = NO; if(whatScrollView == self.TableView00) { tmpNeedSetTv01 = YES; tmpNeedSetTv02 = YES; } else if(whatScrollView == self.TableView01) { tmpNeedSetTv00 = YES; tmpNeedSetTv02 = YES; } else if(whatScrollView == self.TableView02) { tmpNeedSetTv00 = YES; tmpNeedSetTv01 = YES; } if(tmpNeedSetTv00 == YES) { [self.TableView00 setContentOffset:CGPointMake(self.TableView00.contentOffset.x,tmpDesY) animated:NO]; } if(tmpNeedSetTv01 == YES) { [self.TableView01 setContentOffset:CGPointMake(self.TableView01.contentOffset.x,tmpDesY) animated:NO]; } if(tmpNeedSetTv02 == YES) { [self.TableView02 setContentOffset:CGPointMake(self.TableView02.contentOffset.x, tmpDesY) animated:NO]; } } - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [self syncTableViews:scrollView]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload