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

  • Home
  • SEARCH
  • 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 4080968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:59:55+00:00 2026-05-20T17:59:55+00:00

I am trying to add two UIScrollView ‘s into one UIView , Both the

  • 0

I am trying to add two UIScrollView‘s into one UIView, Both the scrollView‘s show up properly, the problem that I am having is how to determine which scrollView is scrolled because based on that I have to populate the images. This is what I am doing:

I have a ViewController with UIScrollViewDelegate.

In the loadView method of my ViewConroller, I do the following:

CGRect scrollViewFrame1;
CGPoint scrollViewPoint1;
scrollViewPoint1.x = 0;
scrollViewPoint1.y = 57;

CGSize scrollViewSize1;
scrollViewSize1.width = 320;
scrollViewSize1.height = 154;

scrollViewFrame1.size = scrollViewSize1;
scrollViewFrame1.origin = scrollViewPoint1;

CGRect scrollViewFrame2;
CGPoint scrollViewPoint2;
scrollViewPoint2.x = 0;
scrollViewPoint2.y = 258;

CGSize scrollViewSize2;
scrollViewSize2.width = 320;
scrollViewSize2.height = 154;

scrollViewFrame2.size = scrollViewSize2;
scrollViewFrame2.origin = scrollViewPoint2;

scrollView1 = [[UIScrollView alloc] initWithFrame:scrollViewFrame1];
scrollView2 = [[UIScrollView alloc] initWithFrame:scrollViewFrame2];

And then:

  scrollView1.delegate = self;
  scrollView2.delegate = self;

And then:

 [self.view addSubView:scrollView1];
 [self.view addSubView:scrollView2];

I have one scrollViewDidScroll: method, how do I determine which scrollView this method got invoked by, because based on that i need to populate different images for my scrollView.

 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
        //Code to populate the next or previous images for scrollView
            // If it was one i am able to show the images
}

Thanks for the help.

  • 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-20T17:59:56+00:00Added an answer on May 20, 2026 at 5:59 pm

    Delegate methods send with it the object that sent the message (the UIScrollView in this case). So, all you have to do is check that against your instance variables of scrollView1 and scrollView2.

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView
    {
        if (scrollView == scrollView1) {
            //do stuff with scrollView1
        } else if (scrollView == scrollView2) {
            //do stuff with scrollView2
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add two image files into the solution, so they will be
I am basically trying to add two view controllers to one controller. I created
I'm trying to add two folders to my eclipse project's classpath, let's say Folder
I'm trying add a tab to my web page that looks like this: Using
trying to add an ExpiresDefault ExpiresByType to content on my website so that way
We have a situation where we are trying to add two UITableViews inside a
I'm trying to add two images together using NumPy and PIL. The way I
I'm trying to add two inputs to a QTCaptureSession in the following: mainSession =
I'm trying to add two Datatriggers to my WPF Window. Normally, this would work
I'm trying to add two strings with snprintf but apparently i dont know what

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.