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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:27:14+00:00 2026-05-16T07:27:14+00:00

I have an array of Image URl’s from that array i have displayed my

  • 0

I have an array of Image URl’s from that array i have displayed my Images in Scrollview because i want to take the advantage of Paging and zooming so what should i do to achieve this task?suppose my array contains 10 URL then by each time scrolling i should get different image and i could also performing Zooming-In and Zooming-Out any of the 10 Images so please give me some guidelines to achieve my task.Thanks 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-05-16T07:27:14+00:00Added an answer on May 16, 2026 at 7:27 am

    Try this

    - (void)setCurrentPage:(NSUInteger)page {
        if (page == offsetX)
            return;
        offsetX = page;
        // in a real app, this would be a good place to instantiate more view controllers -- see SDK examples
    }
    
    - (CGSize)pageSize {
        CGSize pageSize = scrollView1.frame.size;
        if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
            return CGSizeMake(pageSize.height, pageSize.width);
        else
            return pageSize;
    }
    
    - (void)setPagingMode {
        // reposition pages side by side, add them back to the view
        CGSize pageSize = [self pageSize];
        NSUInteger page = 0;
        for (UIView *view in imgViewArray) {
            if (!view.superview)
                [scrollView1 addSubview:view];
            view.frame = CGRectMake(pageSize.width * page++, 0, pageSize.width, pageSize.height);
        }
    
        scrollView1.pagingEnabled = YES;
        scrollView1.showsVerticalScrollIndicator = scrollView1.showsHorizontalScrollIndicator = NO;
        scrollView1.contentSize = CGSizeMake(pageSize.width * [imgViewArray count], pageSize.height);
        scrollView1.contentOffset = CGPointMake(pageSize.width * offsetX, 0);
    
        scrollViewMode = ScrollViewModePaging;
    }
    
    - (void)setZoomingMode {
        NSLog(@"setZoomingMode");
        scrollViewMode = ScrollViewModeZooming; // has to be set early, or else currentPage will be mistakenly reset by scrollViewDidScroll
    
        // hide all pages except the current one
        NSUInteger page = 0;
        for (UIView *view in imgViewArray)
            if (offsetX != page++)
                [view removeFromSuperview];
    
        scrollView1.pagingEnabled = NO;
        scrollView1.showsVerticalScrollIndicator = scrollView1.showsHorizontalScrollIndicator = YES;
        pendingOffsetDelta = scrollView1.contentOffset.x;
        scrollView1.bouncesZoom = YES;
    }    
    
    - (void)scrollViewDidScroll:(UIScrollView *)aScrollView 
    {
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
      { 
      // offsetX=(aScrollView.contentOffset.x)/768;
       //NSLog(@"Page No:%d",offsetX);
          if (scrollViewMode == ScrollViewModePaging)
              [self setCurrentPage:roundf(scrollView1.contentOffset.x / [self pageSize].width)];
    
    
      }
     else 
     {
      //offsetX=(aScrollView.contentOffset.x)/320;
      //NSLog(@"Page No:%d",offsetX);   
         if (scrollViewMode == ScrollViewModePaging)
             [self setCurrentPage:roundf(scrollView1.contentOffset.x / [self pageSize].width)];
    
     }
    }
    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)aScrollView 
    {
        NSLog(@"viewForZoomingInScrollView");
        if (scrollViewMode != ScrollViewModeZooming)
            [self setZoomingMode];
        return [imgViewArray objectAtIndex:offsetX];
    
    }
    
    - (void)scrollViewDidEndZooming:(UIScrollView *)aScrollView withView:(UIView *)view atScale:(float)scale {
        NSLog(@"scrollViewDidEndZooming");
        if (scrollView1.zoomScale == scrollView1.minimumZoomScale)
            [self setPagingMode];
        else if (pendingOffsetDelta > 0) {
            UIView *view = [imgViewArray objectAtIndex:offsetX];
            view.center = CGPointMake(view.center.x - pendingOffsetDelta, view.center.y);
            CGSize pageSize = [self pageSize];
            scrollView1.contentOffset = CGPointMake(scrollView1.contentOffset.x - pendingOffsetDelta, scrollView1.contentOffset.y);
            scrollView1.contentSize = CGSizeMake(pageSize.width * scrollView1.zoomScale, pageSize.height * scrollView1.zoomScale);
            pendingOffsetDelta = 0;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have array of image url. I want to show the images into UIImageView.
i have a requirement, i want to take URL of image from user and
I have image Array with two images out of that first image its showing
I have an array that is taken from an image using exif_read_data($image, 0, true)
I have loaded an byte array image from a web service to my asp.net
I have some array data returned from an ajax call consisting of an image
I have an observable array with var items= [ {image: /images/image1.jpg }, {image: /images/image2.jpg
I have populated an array with a few html image tags that I have
Okay, so I have a JSON array of image URLs. I want to load
I have array of image in scroll view. I want to upload bigger image

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.