Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-20-2009, 10:02 PM   #1 (permalink)
gabacus
Registered Member
 
Join Date: Mar 2009
Posts: 246
Default setAnimationDuration... its just not happening...

hello all

i am trying fade a view in and out... which is simple in concept... but for some reason my code fires instantaneously rather than taken the specified amount of time to animate the transition. here is my code

Code:
- (void) fadeIn {
	[[self myView] setAlpha:0.0];
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:2.0f];
	[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
	[UIView setAnimationBeginsFromCurrentState:YES];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationDidStopSelector:@selector(fadeOut)];
	
	[[self myView] setAlpha:0.8];
	
	[UIView commitAnimations];
}

- (void) fadeOut {
	NSLog(@"fadeOut called"); // just a marker so i can see if this is being called after 2 seconds
}
my problem is when fadeIn is called, the alpha is immediately set to 0.8 and fadeOut is called (i can see the nslog statement pop up as soon as i see the view)

any idea's as to why this is happening?
__________________
-- Website --
SpartanApps

-- Current Apps --
Musicopoulos
gabacus is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,722
Threads: 89,181
Posts: 380,504
Top Poster: BrianSlick (7,124)
Welcome to our newest member, idny99
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:52 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.