• 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: CALayer with No Animation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer with No Animation


  • Subject: Re: CALayer with No Animation
  • From: David Duncan <email@hidden>
  • Date: Mon, 18 Jan 2010 09:11:40 -0800

On Jan 18, 2010, at 7:04 AM, Richard Somers wrote:

> - (void)drawInContext:(CGContextRef)context
> {
>     [CATransaction begin];
>     [CATransaction setValue:(id)kCFBooleanTrue
>                      forKey:kCATransactionDisableActions];
>
>     // Do some CG drawing ...
>
>     [CATransaction commit];
> }
>
> The problem is there is a remnant of an animation in the CALayer instance when the view is resized. It is not a full animation, but appears to be just one or two frames of an animation that occurs when the view is resized. Does anyone know what is happening and how it can be corrected?


-drawInContext: is too early to stop the creation of the animation, as it occurs after -drawInContext: finishes and the layer's contents are set. You need to override -actionForKey:, watch for the @"contents" key, and return nil. There are actually lots of ways to do this so I highly recommend you read the documentation for that action, as the other methods may be useful in other contexts.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

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: CALayer with No Animation
      • From: Richard Somers <email@hidden>
References: 
 >CALayer with No Animation (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: NSURLRequest and NSOperationQueue
  • Next by Date: Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:
  • Previous by thread: CALayer with No Animation
  • Next by thread: Re: CALayer with No Animation
  • Index(es):
    • Date
    • Thread