views:

559

answers:

1

I have one view controller with a UIscrollview built in. There are a total of 42+ images and i'm trying to fade each image into the next

I know i have to use something called "begin animation and commit animation."

I have tried tirelessy to get this to work. Could someone post up the code for me here and have me attempt it one more time? i'm willing to even pay someone for a phone consultation since it's so fustrating. If someone could help me out that would be awesome.

Also, do i have to add anything to my delegate files to get this to work? i'm thinking these few lines of code and i'm good to go right?

thanks

+3  A: 

The following code assumes you have two UIImageViews set up in the same place, but with one's alpha set to 0 (hidden) and the other set to 1 (visible).

[UIView beginAnimations:@"fade in a new image from another" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
oldImageView.alpha = 0.0;
newImageView.alpha = 1.0;
[UIView commitAnimations];
Tyler
works also with every other type of UIView
AlexVogel