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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:56:09+00:00 2026-05-29T10:56:09+00:00

I made an UIScrollView with pages. On Each page I will have an UIScrollView

  • 0

I made an UIScrollView with pages. On Each page I will have an UIScrollView with UIImageView. I want to handle zooming of the images on each page in this way. But zooming delegate method is not being called.
Here is my code:

verticalScroll=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)];
            horizontalScroll=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];



            verticalScroll.backgroundColor=[UIColor purpleColor];
            verticalScroll.pagingEnabled=YES;
            verticalScroll.contentSize=CGSizeMake(768*[largeImagesFromGallery count], 1024);


            horizontalScroll.backgroundColor=[UIColor blackColor];
           horizontalScroll.pagingEnabled=YES;
           horizontalScroll.contentSize=CGSizeMake(1024*[largeImagesFromGallery count], 768);

            float cofVert=1.34f;
            for(int i=0; i<[largeImagesFromGallery count]; i++)
            {
                UIImage *temp=[largeImagesFromGallery objectAtIndex:i];

                UIScrollView *svVert=[[UIScrollView alloc] initWithFrame:CGRectMake(i*768, 0, temp.size.width/cofVert, temp.size.height/cofVert)];

                svVert.contentSize=CGSizeMake(temp.size.width/cofVert, temp.size.height/cofVert);
                svVert.zoomScale=3.0f;
                svVert.delegate=self;


                UIImageView *imageVert=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, temp.size.width/cofVert, temp.size.height/cofVert)];
                imageVert.image=temp;

                imageVert.tag=2000;


                 UIScrollView *svHor=[[UIScrollView alloc] initWithFrame:CGRectMake(i*1024, 0, temp.size.width, temp.size.height)];
                svHor.delegate=self;
                svHor.contentSize=CGSizeMake(temp.size.width, temp.size.height);

                UIImageView *imageHor=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, temp.size.width, temp.size.height)];
                imageHor.image=temp;
                imageHor.tag=2000;

                [svVert addSubview:imageVert];
                [svHor addSubview:imageHor];
                [verticalScroll addSubview:svVert];
                [horizontalScroll addSubview:svHor];


                    //fr=CGRectMake(0, 0, 768, 1024);
                    //[verticalScroll addSubview:imageVert];
                  //  [horizontalScroll addSubview:imageHor];


            }
            //verticalScroll.delegate=self;
           // horizontalScroll.delegate=self;
            ambiancesON=YES;
            if(self.interfaceOrientation==UIInterfaceOrientationPortrait || self.interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown)
            {
                [self.view addSubview:verticalScroll];
            }
            else if(self.interfaceOrientation==UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation==UIInterfaceOrientationLandscapeRight)
            {
                [self.view addSubview:horizontalScroll];

            }

So now I have zoom method:

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {

    NSLog(@"Log log log");
    NSLog(@"VIew? %@", [[scrollView subviews]objectAtIndex:0]);

    return [[scrollView subviews]objectAtIndex:0];
}

Zoom is not being called((

  • 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-29T10:56:10+00:00Added an answer on May 29, 2026 at 10:56 am

    I think there is a flaw in your design. I would recommend creating a view controller class for each of the inner scrollviews (the ones you want to respond to the zoom). That way, if everything is wired correctly (UIScrollView delegates are assigned to the inner view controller), it should work as you expect.

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

Sidebar

Related Questions

I made a custom UITableView subclass and implemented this: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { //
I made a UIViewController, which programatically generates a UIScrollView. Everything's fine, but when I
i have made iPhone Application and i want to make it iPad Compatible without
I have a UIScrollView with an UIImageView as the content. It displays fine, and
I made a UIScrollView, added a UIImageView to as a subView, set the viewForZoomingInScrollView:
I have uiimageviews as subviews for uiscrollview. I made my uiviewcontroller resize the scrollview
I use UIScrollView to make large-sized (larger than 320px) UI on iPhone. I made
Actually, a UITableView is a UIScrollView (inherits from that). Now, I made a UITableView
Made this nice little loop for hiding and showing div's, works as a charm
I have three UITableViews that should look identical. Each is placed inside a different

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.