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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:57:04+00:00 2026-06-13T13:57:04+00:00

I am working on UIScrollview with ImageArray. Scrolling and paging are working but I

  • 0

I am working on UIScrollview with ImageArray. Scrolling and paging are working but I not able to zoom each image. My code of image Scrollview is below :-

#define IMAGE_WIDTH 320

#define IMAGE_HEIGHT 360

 - (void)viewDidLoad
 {
[super viewDidLoad];

// TODO – fill with your photos
NSArray *photos = [[NSArray arrayWithObjects:
                    [UIImage imageNamed:@"photo1m.jpg"],
                    [UIImage imageNamed:@"photo2m.jpg"],
                    [UIImage imageNamed:@"photo3m.jpg"],
                    [UIImage imageNamed:@"photo4m.jpg"],
                    nil] retain];
// note that the view contains a UIScrollView in aScrollView

    int i=0;
    for ( NSString *image in photos )
    {
       UIImage *images = [photos objectAtIndex:i];
       imageView = [[UIImageView alloc] initWithImage:images];
       imageView.contentMode = UIViewContentModeScaleAspectFit;
       imageView.clipsToBounds = YES;

       imageView.frame = CGRectMake( IMAGE_WIDTH * i++, 0, IMAGE_WIDTH, IMAGE_HEIGHT);

       [self.scrollViewimages addSubview:imageView];
      [imageView release];
     }
      self.scrollViewimages.contentSize = CGSizeMake(IMAGE_WIDTH*i, IMAGE_HEIGHT);
      self.scrollViewimages.delegate = self; 
 }

Need to help for implementing pinch zoom of every images. Please 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-06-13T13:57:06+00:00Added an answer on June 13, 2026 at 1:57 pm
    for ( NSString *image in photos )
        {
           UIImage *images = [photos objectAtIndex:i];
           imageView = [[UIImageView alloc] initWithImage:images];
           imageView.contentMode = UIViewContentModeScaleAspectFit;
           imageView.clipsToBounds = YES;
           imageView.tag = 1;
    
           UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake( IMAGE_WIDTH * i++, 0, IMAGE_WIDTH, IMAGE_HEIGHT)];
           scrollView.delegate = self;
           scrollView.maximumZoomScale = 3.0f
           imageView.frame = scrollView.bounds;
           [scrollView addSubview:imageView];
           [imageView release];
    
           [self.scrollViewimages addSubview:scrollView];
    
         }
    

    And Implement the delegate method in UIScrollViewDelegate

    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
        return [scrollView viewWithTag:1];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying this code on UIScrollView but it's not working. The NSLog is
I have a uisegmentedcontrol within a horizontally scrolling uiscrollview. The scrollview is working just
I'm working on a app that has a paging UIScrollView that contains three scrollViews
For some reason UIScrollView is not working. It did work before I add the
I'm using UIScrollView and using scrollRectToVisible:animated This is working fine for me. But I
I have a UIScrollView , and enabled scrolling . Its working fine with delegate
Possible Duplicate: UIScrollView pauses NSTimer until scrolling finishes I have a scrollview and a
UIScrollView in paging mode assumes the pages are located right next to each other,
I'm new to iPhone development and am working on this tutorial: http://www.iosdevnotes.com/2011/03/uiscrollview-paging/#comment-25166 - but
I am working on an application where i need to place a uiscrollview within

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.