开发者

Animating a series of images using blocks in iOS 4

I'm relatively new to iOS and I want to animate an UIImageview through a series of images. I would usually do this with code like this:

UIImageView *planetView = // get view I want to animate //
[planetView setAnimationImages: [NSArray arrayWithObjects:image1, image2, image3, image4, image5, image6, nil]];
[planetView setAnimationDuration:0.65];
[planetView setAnimationRepeatCount:1];
[planetView startAnimating];

However I want to start using blocks properly for this and so far I'm stumped. I also need to remove the planetView from the superview after its done its animation. I thought of using "transitionFromView" but that only goes from one view to a second, not a s开发者_开发知识库eries of them.

Any help would appreciated.


There are no block-using methods for this. I think you're confusing UIImageView animations (much like animated GIFs) with UIView animations in general.

As for removing it from display, there are no callbacks AFAIK. You can try using an NSTimer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜