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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:46:09+00:00 2026-06-11T04:46:09+00:00

I have a CABasicAnimation with a .fromValue and a .toValue that move in an

  • 0

I have a CABasicAnimation with a .fromValue and a .toValue that move in an PNG image with 202 images and display them one by one

also i used CALayer to hold the image.png

the problem that it pass all the images by sequence
i want to display the images by frames that i will put in an NSArray

here is my code:

CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"sampleIndex"];
anim.fromValue = [NSNumber numberWithInt:1];
anim.toValue = [NSNumber numberWithInt:203];
anim.duration = 1.75f;
anim.repeatCount = HUGE_VALF;
anim.autoreverses = YES; 
[myImage addAnimation:anim forKey:nil];

and the array of frames is:

frames =   (753, 377, 798, 422)  ,
  (706, 377, 751, 422)  ,
  (659, 377, 704, 422)  ,
  (612, 377, 657, 422)  ,
  (565, 377, 610, 422)  ,
  (518, 377, 563, 422)  ,
  (518, 424, 563, 468)  ,
  (471, 424, 516, 468)  ,
  (424, 424, 469, 468)  ,
  (471, 377, 516, 422)  ,
  (424, 377, 469, 422)  ,
  (377, 377, 422, 422)  ,
  (330, 377, 375, 422)  ,

and so on ….

Any Ideas ??

  • 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-11T04:46:10+00:00Added an answer on June 11, 2026 at 4:46 am

    Similarly to your frame array you can add all the needed images(frames) to UIImageView. Here is the example:

    NSArray *images = [NSArray arrayWithObjects: 
                  [UIImage imageNamed:@"frame753.png"],
                  [UIImage imageNamed:@"frame377.png"],
                  [UIImage imageNamed:@"frame798.png"], 
    
                  nil];
    yourImageView.animationImages = images; 
    yourImageView.animationDuration = 1.75; 
    yourImageView.animationRepeatCount = 0;
    [yourImageViewstartAnimating]; 
    

    Hope this helps.

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

Sidebar

Related Questions

I have this simple animation that moves an image from one point to another:
Have deployed numerous report parts which reference the same view however one of them
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have this code to move a view. CABasicAnimation *theAnimation; theAnimation=[CABasicAnimation animationWithKeyPath:@transform.translation.x]; theAnimation.duration=1; theAnimation.repeatCount=1;
I have an endlessly looping CABasicAnimation of a repeating image tile in my view:
I have to scroll the images one by one. THe following are the code
I have a CABasicAnimation that animating a property of a CALayer e.g. bounds.origin .
I'm making an app that uses the full screen to display an image like
I have grouped 4 CABasicAnimation into CAAnimationGroup . But the problem is that -(void)
I have an UIImageView which I can rotate using CABasicAnimation . That works fine.

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.