Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7672945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:24:01+00:00 2026-05-31T16:24:01+00:00

I want to make two tables on single screen, so that if Table A

  • 0

I want to make two tables on single screen, so that if Table A is scrolled down render Table B simultaneously scrolling up. Can someone code it or provide me any easy way to do that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:24:02+00:00Added an answer on May 31, 2026 at 4:24 pm

    As Wubao mentioned, you have to use the UIScrollViewDelegate. But you have to check, which scrollView is dragging / active at the moment. Because else you will have the problem that you will get delegate callbacks from both scrollviews and they will give their change to each other at the same time resulting in an endless loop / in endless scrolling.

    In detail, you have to check: - (void)scrollViewDidScroll:(UIScrollView *)scrollView

    But you have to remember the previous offset, so you do know the change of the value.
    (Or your views have the same height. Then you could just use contentSize.height-offset as the offset for the other view.

    I’ll try to write it down a little bit (untested):

    @interface ViewController () <UITableViewDelegate,UIScrollViewDelegate>
    
    // instances of your tableviews
    @property (nonatomic, strong) UITableView *tableLeft;
    @property (nonatomic, strong) UITableView *tableRight;
    
    // track active table
    @property (nonatomic, strong) UIScrollView* activeScrollView;
    
    // helpers for contentoffset tracking
    @property (nonatomic, assign) CGFloat lastOffsetLeft;
    @property (nonatomic, assign) CGFloat lastOffsetRight;
    
    @end
    
    
    @implementation ViewController
    
    - (void) viewDidLoad
    {
      [super viewDidLoad];
      self.tableLeft.delegate  = self;
      self.tableRight.delegate = self;
    }
    
    – (void) scrollViewWillBeginDragging: (UIScrollView*) scrollView
    {
       self.activeScrollView = scrollView;
       self.tableViewRight.userInterActionEnabled = (self.tableViewRight == scrollView);
       self.tableViewLeft.userInterActionEnabled  = (self.tableViewLeft  == scrollView);
    }
    
    - (void) scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
    {
       if(!decelerate) {
         self.activeScrollView = nil;
         self.tableViewRight.userInterActionEnabled = YES;
         self.tableViewLeft.userInterActionEnabled  = YES;
       }
    }
    
    - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
    {
         self.activeScrollView = nil;
         self.tableViewRight.userInterActionEnabled = YES;
         self.tableViewLeft.userInterActionEnabled  = YES;
    }
    
    - (void) scrollViewDidScroll:(UIScrollView *)scrollView
    {
      if(self.activeScrollView == self.tableViewLeft)
      {
        CGFloat changeLeft  = self.tableViewLeft.contentOffset.y  - self.lastOffsetLeft;
        self.tableViewRight.contentOffset.y += changeLeft;
      }
      else if (self.activeScrollView == self.tableViewRight)
      {
        CGFloat changeRight = self.tableViewRight.contentOffset.y - self.lastOffsetRight;
        self.tableViewLeft.contentOffset.y += changeRight;
      }
    
      self.lastOffsetLeft  = self.tableViewLeft.contentOffset.y;
      self.lastOffsetRight = self.tableViewRight.contentOffset.y;
    }
    
    @end
    

    Thats it basically. It also locks the not active scrollview. Because scrolling both would result in ugly behaviour. Also contentOffset.y += changeLeft; wont work probably. You have to create a new CGPoint/CGSize.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a table that simply has two integer columns to serve
I have two QTreeWidgetItem that are top level. I want to make the second
I want to make two MySQL records in two different tables and the goal
I have two database tables. One table stores data for a commitment that a
I want to make two block stand side by side. In Opera, Chrome and
I have two DateTime objects: StartDate and EndDate . I want to make sure
Let's make this very easy. What I want: @array = qw/one two one/; my
I want to make an etag that matches what Apache produces. How does apache
I want to make a two column layout using DIVs, where right column will
I have the following two tables: CREATE TABLE `table1` ( `ID` int(11) NOT NULL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.