3

I have been trying create simple "block-based animation". I am using an array of images "images" here. I used this method:

 [UIView animateWithDuration:3.0 
                       delay:0.0f 
                     options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionCurveLinear 
                  animations:^{ imageview.animationImages = images; } 
                  completion:nil];

However no change happens when I alter the values of parameters animateWithDuration: and delay: I want to slow down the animation but no change happens even when I change these values to 20-30. Please help.

2 Answers 2

1

To change images in a UIImageView, you don't have to put it inside an animation block. You have to use UIImageView's animationImages and animationDuration properties, as well as probably - startAnimating and - stopAnimating methods of the UIImageView.

2
  • allright i can try that but how am i gonna deal with delay? I want my animation to start after 1 second delay. Thx. Jul 7, 2012 at 14:31
  • 1
    You could do have [imageView performSelector:@selector(startAnimating) withObject:nil afterDelay:1] in the - viewWillAppear method. Jul 7, 2012 at 14:33
0

Add array of images to

animationImages

of UIImageView

and give some animationDuration

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.