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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:59:34+00:00 2026-06-03T21:59:34+00:00

I have to scroll the images one by one. THe following are the code

  • 0

I have to scroll the images one by one. THe following are the code which i am using

_imageView is UIImageView and imagesArray is the NSArray with array of objects.

   _imageView.animationImages=imagesArray;
   _imageView.animationDuration=10;
    [_imageView startAnimating];
     
    CABasicAnimation *scrollText;
    scrollText=[CABasicAnimation animationWithKeyPath:@"position.x"];
    scrollText.duration = 10.0;
    scrollText.speed= 3; 
    scrollText.repeatCount = 0;
    scrollText.autoreverses = NO;
    
    scrollText.fromValue = [NSNumber numberWithFloat:500];
    scrollText.toValue = [NSNumber numberWithFloat:-200.0];
    
    [[_imageView layer] addAnimation:scrollText forKey:@"scrollTextKey"];

I can see that images are scrolling and it is changing one by one.
But these images are changing irrespectively. I want to change the image one by one when it leaves the frame/Screen. Can any one suggest some idea ?

  • 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-03T21:59:35+00:00Added an answer on June 3, 2026 at 9:59 pm

    I’m not quite sure what you are asking. I think you’re saying that you want to create an animation where a series of images start at the bottom of the screen and animate up to the top, and off the screen.

    To do that, you’d probably want to create an animation that animates an image from off-screen on the bottom to off-screen on the top, and then loop that animation several times with different images. Something like this.

    Define an instance variable imageNumber. Set it to zero and call animateImage (below) to start the animation.

    The code might look something like this:

    -(void) animateImage;
    {
      _imageView.image = [imagesArray objectAtIndex: imageNumber];
      CGPoint imageCenter = _imageView.center;
      imageCenter.y = 500;
      _imageView.center  = imageCenter;
      [UIView animateWithDuration: 10
        delay: 0.0
        options: UIViewAnimationOptionCurveLinear
        animations: 
        ^{
           CGPoint newImageCenter = _imageView.center;
           newImageCenter.y = -200;
           _imageView.center  = imageCenter;
        completion:
        ^{
          imageNumber++;
          if (imageNumber < [imagesArray count])
            [self animateImage];
        }
      ];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to scroll images in vertical direction (uses jCarouselLite )
i have a scroll view with multiple images and i am using this code.
I have a scroll view holding a few images, each one is around 100KB.
I have a UIScrollView that houses a gallery of images the user can scroll
I have a scroll viewer in my application that contains a canvas, in which
I have scroll view with page controll i have images in scroll view i
I have a infinite scroll script which works for my tumblr . It's loading
I just designed a portfolio website. I have a whole array of images that
I have a div which contains two nested divs, one that specifies a height
In my app I have a table view and 4 images view in one

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.