• 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: Snapshotting hidden UIViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Snapshotting hidden UIViews


  • Subject: Re: Snapshotting hidden UIViews
  • From: Michael Gardner <email@hidden>
  • Date: Thu, 14 Jan 2010 11:22:19 -0600

On Jan 13, 2010, at 10:30 PM, glenn andreas wrote:

> 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)

That still leaves the question of how to capture the contents of a UIView in an image when the view isn't visible.

By the way, I tried the trick Matt suggested earlier in the thread, by obscuring my view behind another one instead of making it hidden. It didn't work. Is UIKit smart enough to know that a view behind another (opaque) view is effectively hidden?

-Michael_______________________________________________

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: Snapshotting hidden UIViews
      • From: "Paul Sanders" <email@hidden>
References: 
 >Re: Snapshotting hidden UIViews (From: Matt Neuburg <email@hidden>)
 >Re: Snapshotting hidden UIViews (From: Michael Gardner <email@hidden>)
 >Re: Snapshotting hidden UIViews (From: glenn andreas <email@hidden>)
 >Re: Snapshotting hidden UIViews (From: Michael Gardner <email@hidden>)
 >Re: Snapshotting hidden UIViews (From: glenn andreas <email@hidden>)

  • Prev by Date: NSTableView column bindings and "deep" key paths
  • Next by Date: Re: Trying to create an alias file by using the new NSURL methods available with Mac OS X 10.6 !
  • Previous by thread: Re: Snapshotting hidden UIViews
  • Next by thread: Re: Snapshotting hidden UIViews
  • Index(es):
    • Date
    • Thread