I was tinkering with UIScrollView a while back, just doing a simple demo to First , use a CATiledLayer as the layer class for my Starview. My current approach involves hosting a CATiledLayer (to fetch & render tiles in the current view frame) inside a UIScrollView (for event. The built-in zoom support in CATiledLayer integrates well (i.e., easily) with a UIScrollView, but it doesn’t quite work the way I’d like, and it’s not.

Author: Bajinn Kazshura
Country: Fiji
Language: English (Spanish)
Genre: Business
Published (Last): 10 May 2006
Pages: 153
PDF File Size: 5.66 Mb
ePub File Size: 14.68 Mb
ISBN: 188-9-82015-845-4
Downloads: 52719
Price: Free* [*Free Regsitration Required]
Uploader: Dibei

Scott’s Space Wars emulator. Determines the maximum scale factor that can be applied to the viewport s. Not all the tiles seem to load even though I can see requests are being made for thembut Uiscrollview worry about that later. It should return discrete values based on powers of 2, and not be continuous as it is in the demo.

I just started using CATiledLayer tonight. My suspicion is something is going wrong in one of the threads owned by CATiledLayer; I don’t get any subsequent calls to drawLayer: That’s basically all there is to it, you can just draw as if the entire coordinate space is just there.

iphone – UIScrollView and CATiledLayer from the ground up – Stack Overflow

I think the idea catiledlayeer a CATiledLayer seems to be that you add it to a view: I am trying to do catiledlaer the same thing and are having similar hassles to what you are I can explain if needed, but look around on Google Groups and you’ll find the appropriate thread. Second, I need to trigger a redraw of the image when the zoom level changes. Facebook Email Reddit Twitter.


For instance, if you were applying a scale factor of 0.

This entry was posted in iPhone. I think the idea behind a CATiledLayer seems to be that you add it to a view:. For my sample graphic, I grabbed the Quartz sample code from another Apple sample, just to have something to draw.

When I zoomed in, the image was very blurry. Thank you very much in advance for any reply. I recommend keeping contentSize and CATiledLayer size under px x px, maintaining the offset of this rect from the absolute map size for the zoom level in an instance property. Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject to these policies.

By continuing to use this website, you agree to their use.

Aside from being slightly confusing, this makes the process of resizing the world — which might make sense for certain applications — potentially more complex. The big change to TiledView has to do with tile index calculation. NO]; Ok, so far so good. Note that that code is still not great. And more generally, does this approach even make sense?

CATiledLayer (Part 2)

Now I discovered that the phone wouldn’t render the UIView if it’s width is larger than pixels. Panning outside of this region is an exercise left to the reader.

In my case it was 20 minutes well spent, boosting user experience by several orders of magnitude. Home About this Blog.

It’s been a month since you asked but this may still be of use. Sep 23, 5: Sep 23, 2: What might cause this? Things seem to run ok in standard resolution on either simulated or actual hardware but high-res tiling can take a long time to catiledlyaer up the screen. My content view has a scaled of 0. Mac OS X The big problem right now is that the simulator freezes up on subsequent calls to setCenter: Services Drop me a note here.


A very simple UIScrollView demo – Hal Mueller’s Blog

So you should only need to slightly modify your Graph class so cagiledlayer can act as a CATiledLayer delegate. Things that were not immediately obvious to me. Message was edited by: I was missing a couple of key points. Begin by opening up zoomdemoViewController. Sep 29, By catiledlayrr our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

The built-in zoom support in CATiledLayer integrates well i. Ideally I would like to keep the Graph class untouched, just draw the context entirely, split it into tiles and scroll those. This site uses cookies.

Zooming a UIScrollView without a CATiledLayer

I cxtiledlayer no trouble getting the CATiledLayer to pull in the correct tiles; my problem is in figuring out the interaction between views and layers. I’ve logged my screen geometry stats here: Stepping through with the debugger, I see that this thread exits before the hang happens. Sorry, your blog cannot share posts by email. Post as a guest Name.

Author: admin