Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
03/20/15 02:00 PM (9 years ago)

Animation Transition?

How would I change this block of code to "fade" between the images? It works great, but I don't want an immediate change between images. Too harsh. Thank you. // **************************** animate images ************* // Load images NSArray *imageNames = @[@"pier.jpg", @"pier2.jpg", @"pier3.jpg", @"pier4.jpg"]; 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:CGRectMake(0, 0, [[UIScreen mainScreen] applicationFrame].size.width, [[UIScreen mainScreen] applicationFrame].size.height)]; animationImageView.animationImages = images; animationImageView.animationDuration = 20.5; [self.backgroundImageView addSubview:animationImageView]; [animationImageView startAnimating]; // ***********************************************************
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/21/15 10:47 AM (9 years ago)
It's possible I'm missing the question, but if you're looking for a 'different' transition, you might try 'crossfading' the images rather than just a fade. There is a good blurb about it here: http://stackoverflow.com/questions/12810195/ios-crossfading-multiple-images-in-imageviews Cheers! -- Smug
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
03/21/15 11:08 AM (9 years ago)
Hi Smug. I am looking for ANY transition. Fade or cross fade. This just switches instantly to the next image. I will check out your suggested link later today. Thank you.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.