Posted By

dannolan on 09/27/10


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

umang_nine
bobbym245
cnathan


Background image crossfade


 / Published in: Objective C
 

  1. //Crossfading between two images
  2. CABasicAnimation *crossFade = [CABasicAnimation animationWithKeyPath:@"contents"];
  3. crossFade.duration = 5.0;
  4. //UIImage
  5. crossFade.fromValue = image1.CGImage;
  6. //UIImage
  7. crossFade.toValue = image2.CGImage;
  8. //Perform the crossfade
  9. [_imageView.layer addAnimation:crossFade forKey:@"animateContents"];
  10. //Set the background image
  11. [_imageView setImage:image2];
  12.  

Report this snippet  

You need to login to post a comment.