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 10-02-2009, 05:06 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2009
Posts: 1
Post UIImageView animation

Hello,

I have started learning about animating images and have a question regarding UIImageView class. I am trying to animate 2 images (png) to fall down from the top of the screen to the middle one after another and placed side by side on the x-axis. Example, image 1 is animated to move to co-ordinate x,y. Once that is done, image 2 is animated to move to it's coordinates

However, the following code animates both of them at the same time instead of animating image 1 falling into place and then image 2 falling into place:

Code:
	for (UIImageView *imageToDisplay in imageArray) {
		[imageToDisplay setFrame:CGRectMake(startXPos, 0, imageToDisplay.image.size.width, imageToDisplay.image.size.height)];
		
		[UIView beginAnimations:nil context:nil]; // begin the animation block
		[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
		[UIView setAnimationDuration:0.55]; // set the animation length
		[UIView setAnimationRepeatCount:0];
		
		[self.view addSubview:imageToDisplay];
		
		[imageToDisplay setFrame:CGRectMake(startXPos, yPos, imageToDisplay.image.size.width, imageToDisplay.image.size.height)];
		
		startXPos+=xIncrement;
		[UIView commitAnimations]; // end the animation block
	}
I'm still learning and would appreciate any feedback.

Cheers!

Last edited by imdapps; 10-02-2009 at 05:55 PM.
imdapps is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, graphics, 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: 351
19 members and 332 guests
ADY, Alsahir, Dani77, e2applets, JasonR, keeshux, mer10, Monstertaco, piesia, prchn4christ, Promo Dispenser, Robiwan, sebasx, sly24, Touchmint, twerner, zulfishah
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,759
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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