• 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
How to use animation for CALayer frame.size attribute?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to use animation for CALayer frame.size attribute?
      • From: Matt Long <email@hidden>
  • Prev by Date: MathPaper (Chapter 10) fails
  • Next by Date: Re: Using runtime functions to match up object types safely when setting properties
  • Previous by thread: Re: MathPaper (Chapter 10) fails
  • Next by thread: Re: How to use animation for CALayer frame.size attribute?
  • Index(es):
    • Date
    • Thread