I have an image that I want to animate continuously in UIImageView. Like left to right and some image objects to move?
Thanks in advance
Create an animation in the image editor (or something else if you have Then there is an animation) >
Then save each frame as an image Create a folder in your Xcode project and import files into it (named "frame-x page" in the example below each frame Where x is the frame number)
Then create an array of UIImages and UIImageView's animation image Set this to:
imageView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed: @ "frame-1"], [UIImage imageNamed: @ "frame-2"], [UIImage imageNamed : @ "Frame-3"], [UIImage imageNamed: @ "frame-4"], zero];
Where you have a UIImage for each frame, then you start the animation:
[imageView startAnimation]; You can also set the animationRepeatCount property of the image view.
See for more information.
Comments
Post a Comment