How to use animation for CALayer frame.size attribute?
How to use animation for CALayer frame.size attribute?
- Subject: How to use animation for CALayer frame.size attribute?
- From: Alex.Wang <email@hidden>
- Date: Sat, 20 Dec 2008 17:04:48 +0000
Hi everyone.I am trying to create some animation when to change the size of
a CALayer object.
My code looks like this:
CABasicAnimation * _animation =[CABasicAnimation animation].
[_animation setKeyPath:@"frame.size"];
NSSize _size;
*_size.**width** = 400**;*
*_size.**height** = 300**;*
*_animation.fromValue = [NSValue valueWithSize:_size];*
*_size.**width** = 200**;*
*_size.**height** = 150**;*
*_animation.toValue = [**NSValue** **valueWithSize**:_size];*
*[_layer **addAnimation**:_animation*
* **forKey**:_animationKey];*
However, the above code doesn't work at all. Can anyone tell me what is
wrong with that? Or did I miss anything?
Thank you very much for any help or guidance.
Good luck.
--
Best regards.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden