Nov 152009
Using Core Animation you can crossfade between two images. The image on top is image1 and the bottom image is image2.
//This will fade image2 into image1 whenever it is called.
- (void) crossfade {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
imageView1.alpha = !imageView1.alpha;
[UIView commitAnimations];
}
// This will remove the 1st image and fade into the 2nd.- (void) crossfade { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:.5]; [UIView setAnimationDelegate:imageView1]; [UIView setAnimationDidStopSelector:@selector(removeFromSuperview)]; imageView1.alpha = 0 [UIView commitAnimations]; }

Follow me on Twitter
Sorry, the comment form is closed at this time.