• 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: force rendering of views off screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: force rendering of views off screen


  • Subject: Re: force rendering of views off screen
  • From: Martin Glaß <email@hidden>
  • Date: Fri, 2 Jul 2010 19:38:01 +0200

hello guys,

thanks for your comments - i just found the right knob to draw the
content of my "invisible" subview in my uiscrollview.
i simply subclassed every subview and implemented -drawRect:
additionally using uigraphicsgetcurrentcontext().

@david
yeah, this was just simple math to picture the scene - but you're
right, it depends...
and could you tell the iOS team i feel great with their APIs, please? thx ;)

here's the (ugly) method code, pdfRef and pageNo are properties of the
enclosing class/instance.

- (void) drawRect:(CGRect)rect {
	// get the page reference
	CGPDFPageRef page = CGPDFDocumentGetPage(pdfRef, pageNo);
	CGContextRef context = UIGraphicsGetCurrentContext();

	// white background
        CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
        CGContextFillRect(context, CGContextGetClipBoundingBox(context));

	// transformation/-lation
	CGContextTranslateCTM(context, 0.0, rect.size.height);
	CGContextScaleCTM(context, 1.0, -1.0);
        CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(page,
kCGPDFCropBox, rect, 0, true));
	CGContextDrawPDFPage(context, page);

}

hope this help's someone else.

- bye

2010/6/24 David Duncan <email@hidden>:
> On Jun 24, 2010, at 8:59 AM, Martin Glaß wrote:
>
>> sorry, CATiledLayer actually improves performance. the downside is,
>> the tiles need time to be drawn and are faded in using an animation of
>> 0.25 seconds.
>> so, if there are 6 tiles to be drawn you end up seeing iOS building
>> the "mosaic" in a total of 1.5 seconds.
>
> The fade time is not synchronous with the content generation. If you generate content fast, it could all fade in in 0.25s. If it is taking longer, it is due to the rendering time of that content, but unless your rendering time is 0.25s it is unlikely that you will take exactly 1.5s for all of it to display :).
>
> --
> David Duncan
>
>
_______________________________________________

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

  • Prev by Date: Re: Bypass Network System Preferences for DNS lookup
  • Next by Date: Re: Flushing NSOutputStream gotten from NSNetService
  • Previous by thread: Core Animation vs. table/browser/matrix views - looking for advice
  • Next by thread: NSMatrix setState and setSelectionFrom
  • Index(es):
    • Date
    • Thread