• 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
Core Animation layout behavior during live window resize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Animation layout behavior during live window resize


  • Subject: Core Animation layout behavior during live window resize
  • From: Ben Kazez <email@hidden>
  • Date: Wed, 6 Feb 2008 14:12:35 -0600

Hi,

I have a layer-backed view that resizes to fit the available space in the window. During live window resizes, I'd like the layers to resize with no animation.

1. I get a crash when I begin a transaction and use kCATransactionDisableActions within the layout manager's - layoutSublayersOfLayer method.

2. Disabling actions within a transaction from viewWillStartLiveResize/ viewDidEndLiveResize seems to disable the animation, but I can't be sure, because the view content isn't updated properly: The background color of the root layer is not redrawn, and the layers do not reposition themselves.

3. To fix #2, I tried setAutoresizesSubviews:YES and laying out the root layer (-layoutIfNeeded or -setNeedsLayout) from - resizeSubviewsWithOldSize, but this had no effect.

4. As a proof of concept, I tried unsetting the root layer from the view (setLayer:nil) and setting wantsLayer:NO, and then drawing a plain black background in -drawRect during live resizes. (My thinking was that eventually I'd render the root layer contents to an image and scale the image to provide a low-resolution preview during live window resizes.) However, this caused crazy drawing artifacts and window flickering.

I'm surely missing something obvious. What's the recommended way of doing this?

Ben
_______________________________________________

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: Core Animation layout behavior during live window resize
      • From: Troy Stephens <email@hidden>
  • Prev by Date: Re: NSXMLDocument unable to parse valid HTML with scripts in the body [SOLVED]
  • Next by Date: Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
  • Previous by thread: Re: Hep with IOKit.framework - it destroyed my project.
  • Next by thread: Re: Core Animation layout behavior during live window resize
  • Index(es):
    • Date
    • Thread