0

I would like to know based on my code, how can i add fade in fade out effect between each images in my NSArray. As i am using these images as background. Changing background without fade in and out looks horrible.

Here is my code.

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSArray *imageNames = @[@"1.jpg", @"2.png", @"3.png", @"4.png",
                            @"5.png"];

    NSMutableArray *images = [[NSMutableArray alloc] init];
    for (int i = 0; i < imageNames.count; i++) {
        [images addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
    }

    // Normal Animation
    UIImageView *animationImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
    animationImageView.animationImages = images;
    animationImageView.animationDuration = 9;

    [self.background addSubview:animationImageView];
    [animationImageView startAnimating];}
Clarence
  • 1,951
  • 2
  • 34
  • 49
  • The animation you are using is intended for something like the "refresh" control - where you want to animate a series of frames. For a solution where you want to animate unrelated images see - possible duplicate of [Fade/dissolve when changing UIImageView's image](http://stackoverflow.com/questions/7638831/fade-dissolve-when-changing-uiimageviews-image) – Paulw11 Jun 21 '14 at 06:44
  • Have you checked this ? try this may be help full [Fade/dissolve when changing UIImageView's image](http://stackoverflow.com/questions/7638831/fade-dissolve-when-changing-uiimageviews-image) Thanks & Cheers .. – Jogendra.Com Jun 21 '14 at 06:43

0 Answers0