Re: Snapshotting hidden UIViews
Re: Snapshotting hidden UIViews
- Subject: Re: Snapshotting hidden UIViews
- From: glenn andreas <email@hidden>
- Date: Wed, 13 Jan 2010 22:30:03 -0600
On Jan 13, 2010, at 9:46 PM, Michael Gardner <email@hidden>
wrote:
On Jan 13, 2010, at 5:07 PM, glenn andreas wrote:
On Jan 13, 2010, at 4:48 PM, Michael Gardner wrote:
I also tried calling -drawRect: on my hidden view (after setting
the context with UIGraphicsBeginImageContext()), but it doesn't
seem to do anything.
Many built in views do not draw anything at all (and have no useful
drawRect:) - all of their rendering is handled by the view's layer.
Ah, that explains that. But I'd still very much like to know why the
layer's -renderInContext: doesn't work consistently when the view is
hidden.
Pure speculation, but a hidden view may not have a layer associated
with it, and things like subview layout aren't done for hidden views
(why waste cycle laying out the subviews if nobody will see it?).
There are probably other undocumented optimizations as well on hidden
views, such as animations not running, pending refreshes postponed,
etc... UIWebView is going to be especially problematic, since it does
a whole lot of things in the background (such as loading needed images
and other resources)
_______________________________________________
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