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, 04:59 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 83
Default CABasicAnimation class

Hi guys, I'm trying to animate a UIButton, seemingly sliding it out of the view, but when I do this with this class, upon completion, the UIButton snaps back to it's original place, how can I use this class to move something somewhere, but get it to stay there?

Code:
CABasicAnimation *theAnimation;	
	theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
	theAnimation.duration=0.2;
	theAnimation.repeatCount=0;
	theAnimation.autoreverses=NO;
	theAnimation.byValue=[NSNumber numberWithFloat:160];
	[myButton.layer addAnimation:theAnimation forKey:@"animateLayer"];
djp_phillips is offline   Reply With Quote
Old 02-23-2010, 04:18 PM   #2 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 2
Default

Add these properties...


theAnimation.removedOnCompletion = NO;
theAnimation.fillMode = kCAFillModeForwards;
bandejapaisa is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, cabasicanimation, moving, sliding

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: 344
20 members and 324 guests
ADY, Dani77, e2applets, Herbie, JasonR, keeshux, linkmx, 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,760
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:32 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0