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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:31:15+00:00 2026-06-08T05:31:15+00:00

Nested uiscrolls in a larger uiscroll need to, when zoomed, reset zoom level when

  • 0

Nested uiscrolls in a larger uiscroll need to, when zoomed, reset zoom level when they are off screen. I am trying to reset all of them when the scrolling ends but no luck. Any ideas?

myScrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height)];
myScrollview.pagingEnabled = YES;
myScrollview.scrollEnabled =YES;
myScrollview.clipsToBounds = NO;
myScrollview.indicatorStyle = UIScrollViewIndicatorStyleWhite;
myScrollview.showsHorizontalScrollIndicator = YES;
myScrollview.backgroundColor = [UIColor blackColor];
myScrollview.delegate = self;

NSInteger viewcount=4;
NSArray *images = [NSArray arrayWithObjects:[UIImage imageNamed:@"01.png"],[UIImage imageNamed:@"02.png"],[UIImage imageNamed:@"03.png"],[UIImage imageNamed:@"04.png"],nil];

for (int i = 0; i <viewcount; i++)
{
    CGFloat x = i * self.view.frame.size.width;

    subView = [[UIScrollView alloc]initWithFrame:CGRectMake(x, 0, self.view.frame.size.width, self.view.frame.size.height)];

    [subView setBackgroundColor:[UIColor blackColor]];
    [subView setCanCancelContentTouches:NO];
    subView.clipsToBounds = NO;    // default is NO, we want to restrict drawing within our scrollview
    subView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
    aImageView = [[UIImageView alloc ] initWithImage:[images objectAtIndex:i]];
    [self.aImageView setTag:viewcount];
    [subView addSubview:aImageView];
    [subView setContentSize:CGSizeMake(aImageView.frame.size.width, subView.frame.size.height)];
    subView.minimumZoomScale = 1;
    subView.maximumZoomScale = 3;
    subView.delegate = self;
    [subView setScrollEnabled:YES];
    subView.contentSize = aImageView.frame.size;
    [myScrollview addSubview:subView];
}

myScrollview.contentSize = CGSizeMake(self.view.frame.size.width*viewcount,self.view.frame.size.height);


[self.view addSubview:myScrollview];

}

-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
NSLog (@"test");
UIView * view = nil;
view = [subView viewWithTag:0];
//return view;
return [scrollView.subviews objectAtIndex:0];  

}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
NSLog(@"Did scroll");
[self resetImageZoom];

}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
= NSLog(@”Did end decal”);

[self resetImageZoom];

}

-(void)resetImageZoom {
NSLog(@”Resetting any image zoom”);

for(UIView *view in [myScrollview subviews]) {
    //if([view isKindOfClass:[UIScrollView class]]) {
    //[(UIScrollView*)view setZoomScale:1.0 animated:NO];
    //}
    view.transform = CGAffineTransformIdentity;
}

}

  • 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-08T05:31:16+00:00Added an answer on June 8, 2026 at 5:31 am

    That did it…

    -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
    NSLog(@"Did end dece");
    for (UIView *view in scrollView.subviews) {
        if([view isKindOfClass:[UIScrollView class]]) {
            [(UIScrollView*)view setZoomScale:1.0 animated:NO];
        }
    }
    

    }

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

Sidebar

Related Questions

I need to do nested modal popup in my application. all popup's will have
I am using a nested model form to edit all phone numbers of a
I have a nested JSON object that I need to loop through, and the
Nested variables have prevented me from trying to use BASH more extensively... consider the
I have two nested arrays and need to find the difference between the reference
I need to use nested transaction scopes to perform some actions: 1)Insert Address 2)
How do I make nested loops in Python (version 3.0)? I am trying to
I have a gridview nested within a repeater, and I'm trying to enable paging
I have nested ajax calls that are not working in ie7. They work fine
Nested layouts do not work in Rails 3. After I hit this I tried

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.