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-10-2009, 07:29 PM   #3 (permalink)
Legrend
New Member
 
Join Date: Mar 2009
Location: Covina, California - United States
Age: 28
Posts: 22
Default

Hopeful solution:

Set the background color of your main window to black, or whatever the background window/view is for these views. If the views you are trying to transition through are NOT sub-views of any other view, then set the "window" color to black. Then use an animation block to fade them out. I guess CAT would work too, but I haven't messed with much of the Core Animation.

Code:
- (void)fadeScreen
{
     [UIView beginAnimations:nil context:nil]; // begins animation block
     [UIView setAnimationDuration:0.75];        // sets animation duration
     [UIView setAnimationDelegate:self];        // sets delegate for this block
     [UIView setAnimationDidStopSelector:@selector(finishedFading)];   // calls the finishedFading method when the animation is done (or done fading out)	
     view.alpha = 0.0;       // Fades the alpha channel of this view to "0.0" over the animationDuration of "0.75" seconds
     [UIView commitAnimations];   // commits the animation block.  This Block is done.
}


- (void) finishedFading
{
     [UIView beginAnimations:nil context:nil]; // begins animation block
     [UIView setAnimationDuration:0.75];        // sets animation duration
     viewTwo.alpha = 1.0;   // fades the view to 1.0 alpha over 0.75 seconds
     [UIView commitAnimations];   // commits the animation block.  This Block is done.
}
It's worth noting that the animation block will handle smooth alpha fading automatically. So all you have to do is preset your alpha values for your views before each block.

Last edited by Legrend; 03-10-2009 at 07:37 PM. Reason: typo - as always
Legrend is offline   Reply With Quote
 

» Advertisements
» Online Users: 727
14 members and 713 guests
Bertrand21, Inupgames, iphone.savvy, kampftrinker, Macaret, mapiko, nidie, oceanlablight, soonw29, srishtimehta, superblooddrainer, wodanbrlam, Yuvaraj.M
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,825
Threads: 89,207
Posts: 380,637
Top Poster: BrianSlick (7,129)
Welcome to our newest member, srishtimehta
Powered by vBadvanced CMPS v3.1.0

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