views:

542

answers:

2

Hi,

I need to animate and imageview, first rotate it in one direction, shift the center and rotate it in the opposite direction in a single animation loop.

What i did was ::

[UIImageView beginAnimations:nil context:NULL]; [UIImageView setAnimationDuration:2.0]; [UIImageView setAnimationDelegate:self]; [UIImageView setAnimationWillStartSelector:@selector(setRightAngle)];

image.center = CGPointMake(newCenter.x, newCenter.y) ;

[UIImageView setAnimationDidStopSelector:@selector(setStraight)]; [UIImageView commitAnimations];

This is getting the job done, but it happens in 3 steps that is noticeable on the screen. it first turns right,then shifts the center and the set the image to the default angle. i want to remove that noticeable breaks in between to achieve a smooth animation. Can some one suggest me a better approach to this issue?

Thanks & Regards, NR

A: 

Hi Peter, did you ever figure this out? You might want to post your setStraight and setRightAngle methods.

You could also look into formatting the code in your question for better readability.

Since you have noticeable breaks, you could add a timer, and see when your methods are firing, to see when the breaks occur.

I can say from experience that it is possible to use the technique you list here to have smooth animation.

livingtech
A: 

check out this link UIImageView Animation of images http://cocoabugs.blogspot.com/2010/08/uiimageview-animation-of-images.html

jeeva