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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:56:21+00:00 2026-06-16T23:56:21+00:00

I have a uiimageview and I want to move it while the animation of

  • 0

I have a uiimageview and I want to move it while the animation of clock is running.The problem is when I press the button to move, the animation play the images and after the end of playing images, the image start to move 10px. It shouldn’t be like this and the animation and movement should start and end together.

-(IBAction) MoveRightButton : (id) sender {

 [self animateRight];
[self rightTimer];

}

-(IBAction) stopRight {

[image stopAnimating];
[rightTimer invalidate];

}

-(void) animateRight {

NSArray * moveRight = [[NSArray alloc] initWithObjects :
[uiimage imageNamed : @"Clock1.png"] , .... , nil];

UIImage *defaultImage = [UIImage imageNamed : @"Clock1.png"];
[image setImage : defaultFace];
image.animationImages = moveRight;

image.animationDuration = 0.5;
image.animationRepeatCount = 1;
[image startAnimating];
}

-(void) goRight {
[UIView animateWithDuration : 0.5 animation : ^{
image.frame = CGRectMake (image.frame.origin.x + 10, image.frame.origin.y,image.frame.size.width, image.frame.size.height);
}];
[self stopRight];
}

-(void) rightTimer {
rightTimer = [NSTimer scheduledTimerWithTimeInterval : 0.5 
target : self  
selector : @selector(goRight) 
userInfo : nil  
repeats : YES];

if (rightTimer == nil) {
rightTimer = [NSTimer scheduledTimerWithTimeInterval : 0.5 
target : self  
selector : @selector(goRight) 
userInfo : nil  
repeats : YES];
 }
}
  • 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-16T23:56:22+00:00Added an answer on June 16, 2026 at 11:56 pm

    Hi you are doing a simple mistake please do both animation task and right going task in same animation one after other on the click of button…Use one animation block if if want it to happen at once two animation will animate at diffrent time.

    #define StartAnimation(duration)                  [UIView beginAnimations:nil context:NULL];[UIView setAnimationDuration:duration];[UIView setAnimationRepeatAutoreverses:NO];[UIView setAnimationRepeatCount:0]
    
    #define StopAnimation                   [UIView commitAnimations]
    

    define these macro and do task between start and stop animation

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

Sidebar

Related Questions

I have a UIImageView that I want to resize when you press a button.
I want to check if uiimageview is populated, then i have a button i
So i have a UIScrollview with UIImageView set with a button, I want to
I have an app that will show some images using UIImageView, now I want
I have a UIImageView object that when clicked it will play a animation, I
I have an app where I want to have an image animation while I
I have a UIImageView which is in an animation loop. I want to detect
I have an application in which i have to move images, problem is arising
So I have my clock as a UIImageView. Thats perfect the clock doesnt move.
Please help regarding an iPhone animation. I have an UIImageView and I want to

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.