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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-22-2010, 08:29 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 28
Default Animation

Hello, I have a block of animation code and I need to know how to fade between each image. this is my code:

- (void) viewWillAppearBOOL)animated{
[super viewWillAppear:animated];
[self performSelector:@selector(startAnimation) withObject:nil afterDelay:0];
}

- (void) startAnimation{

//self.view.backgroundColor = [UIColor initWithPatternImage:];
ringView.animationImages = [NSArray arrayWithObjects:

[UIImage imageNamed:@"Bear-Background.jpg"],
[UIImage imageNamed:@"Lion-Background.jpg"],
[UIImage imageNamed:@"Donkey-Background.jpg"],
[UIImage imageNamed:@"Goat-Background.jpg"],
[UIImage imageNamed:@"F18-Background.jpg"],
[UIImage imageNamed:@"Jet-Airplane-Background.jpg"],
[UIImage imageNamed:@"Car Background.png"],
[UIImage imageNamed:@"FireTruck Background.png"],nil];

ringView.animationRepeatCount = 0;
[ringView setAnimationDuration:12];
[ringView startAnimating];


}
MacSteve85 is offline   Reply With Quote
Old 02-22-2010, 09:55 PM   #2 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 622
Default

Quote:
Originally Posted by MacSteve85 View Post
Hello, I have a block of animation code and I need to know how to fade between each image.
In general, fades seem to be done by changing the alpha:

Code:
// starts view invisible
myImageView.alpha = 0;
// makes the view fade in to solid
myImageView.alpha = 1;
DenVog is offline   Reply With Quote
Old 02-23-2010, 01:14 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 28
Default

Quote:
Originally Posted by DenVog View Post
In general, fades seem to be done by changing the alpha:

Code:
// starts view invisible
myImageView.alpha = 0;
// makes the view fade in to solid
myImageView.alpha = 1;
That code is just changing the alpha of the UIImageView, I was hoping to fade out from each image and fade in as the new image is appearing.
Any tips?
MacSteve85 is offline   Reply With Quote
Old 02-23-2010, 03:18 PM   #4 (permalink)
indie dev
 
rocotilos's Avatar
 
Join Date: Oct 2009
Posts: 2,754
Default

You need to create 2 animation methods ( 1 to fade in, 1 to fade out ).

Then use the animationdidstop delegate function to queue up the animation.

set a global variable for the image name. like i=0. then calling the images by imageNamed:[NSString stringwithformat:@"image%d.png", i]. increment i at every fade out completion.
rocotilos is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, uiimageview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 283
21 members and 262 guests
2WeeksToGo, ADY, apatsufas, ckgni, dacapo, Dani77, Fritzer, ghost, HDshot, headkaze, jakerocheleau, joeallenpro, masc2279, mer10, mystic.purple, objch, Rudy, tathaastu, themathminister, timle8n1, Zool
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,878
Threads: 89,223
Posts: 380,731
Top Poster: BrianSlick (7,129)
Welcome to our newest member, olga2000
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:38 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0