• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to use animation for CALayer frame.size attribute?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use animation for CALayer frame.size attribute?


  • Subject: Re: How to use animation for CALayer frame.size attribute?
  • From: Matt Long <email@hidden>
  • Date: Sat, 20 Dec 2008 12:47:36 -0700

I'm hoping that all of the asterisks are just artifacts from a copy/ paste maneuver or something, however, if they are not then you're missing some serious fundamentals. This code will never compile.

Let's just assume a copy/paste issue. If you are wanting to animate the size of the frame, use the bounds property instead of frame.

http://developer.apple.com/qa/qa2008/qa1620.html

-Matt



On Dec 20, 2008, at 10:04 AM, Alex.Wang wrote:

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


References: 
 >How to use animation for CALayer frame.size attribute? (From: Alex.Wang <email@hidden>)

  • Prev by Date: Re: Find Panel Stopped Working (maybe)
  • Next by Date: Re: Find Panel Stopped Working (maybe)
  • Previous by thread: How to use animation for CALayer frame.size attribute?
  • Next by thread: toolbar to view gradient displaying correctly only sometimes?
  • Index(es):
    • Date
    • Thread