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 03-09-2009, 02:24 AM   #1 (permalink)
nicksayes
New Member
 
Join Date: Mar 2009
Posts: 1
Default UIImageView alpha fade animation issue

I'm a newbie iPhone developer - going very well, almost finished my first app minus this one issue which I am a little embarrassed to be asking but...

I have a UIImageView that I have animated to fade (alpha value) over the period of 60s. After the animation a UIButton displays. In addition by tapping you can force the alpha value of the UIImageView down as to make the animation appear faster. But I am having trouble determining when the alpha value of my UIImageView is below zero - so that I can display the button - even though the animation is still running. Here is my code:

Code:
- (void)fadeTheImageView
{
	[fadeImageView setAlpha:1.0];

	[UIView beginAnimations:@"theAnimation" context:NULL];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationDidStopSelector:@selector(yourAnimationHasFinished:finished:context:)];
	[UIView setAnimationDuration:10];
	[fadeImageView setAlpha:0.0];
	[UIView commitAnimations];	
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
	if ( fadeImageView.alpha <= 0.0 ) {
		[saveButton setHidden:NO];
	}
	[fadeImageView setAlpha:(fadeImageView.alpha - 0.1)];
}

- (void)yourAnimationHasFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context;
{
	[saveButton setHidden:NO];
}
The error is with the - if ( fadeImageView.alpha <= 0.0 ) {
incompatible variable types.
I've tried everything.

Any help would be appreciated
nicksayes is offline   Reply With Quote
 

» Advertisements
» Online Users: 787
19 members and 768 guests
annchavez78, dfvdan, Domele, elhanche, ghz.rai, gladlard24, Gurpartap Singh, her-ur, HerbertMIbarra, ilmman, Macaret, nidie, phackdat, ratheesh, smethorst, socbaybot, soonw29, Tambourin, twerner
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,822
Threads: 89,206
Posts: 380,635
Top Poster: BrianSlick (7,129)
Welcome to our newest member, gladlard24
Powered by vBadvanced CMPS v3.1.0

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