Core Animation layout behavior during live window resize
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