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 8681603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:33:12+00:00 2026-06-12T21:33:12+00:00

I have main UIScrollView mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 440)]; mainScrollView.pagingEnabled =

  • 0

I have main UIScrollView

mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 440)];
mainScrollView.pagingEnabled = YES;
imageScrollView.contentSize = CGSizeMake(320 * [myImage count], 440);

, which contain many sub UIScrollView, and each sub UIScrollView contains UIImageView

for (int i = 0; i < [myImage count]; i++)
{
    imageView = [[UIImageView alloc] init];
    [imageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];

    NSString *strimage = [myImage objectAtIndex:i];
    NSURL *imageUrl = [NSURL URLWithString:strimage];

    [imageView setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"Placeholder"]];

    imageView.frame = CGRectMake(0, 0, 320, 440);

    subScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(320 * i, 0, 320, 440)];
    subScrollView.contentSize =
    CGSizeMake(imageView.frame.size.width, imageView.frame.size.height);
    subScrollView.pagingEnabled = YES;
    subScrollView.showsHorizontalScrollIndicator = NO;
    subScrollView.showsVerticalScrollIndicator = NO;
    subScrollView.delegate = self;
    subScrollView.bouncesZoom = YES;
    subScrollView.clipsToBounds = YES;

    subScrollView.maximumZoomScale = 3.0;
    subScrollView.minimumZoomScale = 1.0;
    subScrollView.zoomScale = 1.0;

    [mainScrollView addSubview:subScrollView];
    [subScrollView addSubview:imageView];
}

, and I implement

#pragma mark UIScrollViewDelegate methods

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
    return imageView;
}

The problem is when I zoom in UIImageView, assume that there are 3 sub UIScrollView, the last sub UIScrollView can zoom UIImageView normally but the other 2 when I zoom in it , it zooms sub UIScrollView instead of UIImageView, and it effect the last sub UIScrollView to be also zoom, Did I do anything wrong?

I suspect that in viewForZoomingInScrollView, it’s zoom only last UIImageView (last sub UIScrollView).

Thank you in advance 🙂

  • 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-06-12T21:33:13+00:00Added an answer on June 12, 2026 at 9:33 pm

    Finally I figured it out, I just need to update my UIImageView when I zoom in specific UIImageView
    In – (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView like this:

    #pragma mark -
    #pragma mark UIScrollViewDelegate methods
    
    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
        for (UIImageView *iv in [scrollView subviews]) {
            imageView = iv;
            break;
        }
    
        return imageView;
    }
    

    Hope it may help someone, who struggle at this point as me, so you don’t have to waste you time :).

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

Sidebar

Related Questions

I have UIScrollView added to the main window of the app with IB. What
Situation: In the main View Controller, I have a UIScrollView and within that I
I have main UIScrollView with lots off buttons which i create like this: UIButton
I have a UIImageView element as a subview of my main UIScrollView element. I
I have a UIScrollView which contains a view (lets call this main view) which
I have main window which has inner grid components. When I press a button
I have main categories and sub categories. I want to be able to sort
I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has
i have main activity in which i have Four menus. and i have one
I have main.cpp (including main function) and func1.cpp, and I want to link these

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.