I have done the effect of playing lots of images like below:
NSInteger faceNum = 12;
NSMutableArray *faceArray = [[NSMutableArray alloc] initWithCapacity:faceNum];
for (int i = 1;i<faceNum+1; i++) {
NSString *facename = [[NSBundle mainBundle]
pathForResource:[NSString stringWithFormat:@"animationFace%d",i] ofType:@"png"];
UIImage *faceImage = [UIImage imageWithContentsOfFile:facename];
[faceArray addObject:faceImage];
}
UIImageView *faceView = [[UIImageView alloc]
initWithFrame:CGRectMake(414, 157, 161, 124)];
faceView.animationImages = faceArray;
faceView.animationDuration = 30;
faceView.animationRepeatCount = 0;
[faceView startAnimating];
[self.view addSubview:faceView];
[faceView release];
[faceArray release];
And how to add the EaseInEaseOut effect to this.One picture disappear gradually,then another picture appear gradually.
Thanks
There is no inbuilt fade-in and out feature with imageview startAnimating. You can achieve this by manually setting the alpha of two view laid over each other:
and setImage manually alternatively to these UIViews.
and to recursively call this method, use something like
[self performSelector:@selector(methodname) withObject: afterDelay: ]inside the method itself.Edit: For clarity, specifying the recursion to call this method over and over with delay: