Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

simple fade in and fade out

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

like image 557
Dane Avatar asked Dec 18 '22 06:12

Dane


1 Answers

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];
like image 87
Tyler Avatar answered Dec 29 '22 07:12

Tyler