I’m trying to create a floating effect using this code over a UIImageView:
[UIView animateWithDuration:3.0
delay:0.0
options: UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse
animations:^{
self.imageView.transform = CGAffineTransformMakeTranslation(10, 0);
}
completion:^(BOOL end){
}];
This code create a simple effect, moving repeatedly image from left to right by 10 px.
The problem is that moving so slowly, the image has a strange effect and the animation isn’t smooth.
Is there some tricks (or settings) to avoid this problem and to obtain a smooth animation ??
You should animate the center of your view: