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.
|Genre:||Health and Food|
|Published (Last):||27 October 2015|
|PDF File Size:||18.90 Mb|
|ePub File Size:||18.32 Mb|
|Price:||Free* [*Free Regsitration Required]|
CATiledLayer (Part 2) | Things that were not immediately obvious to me
Vote stealing, or just clunky machines? That’s basically all there is to it, you can just draw as if the entire coordinate space is just there. To start the conversation again, simply ask a new question.
All replies Drop Down menu. Second, I need to trigger a redraw of the image when the zoom level changes. I’ve logged my screen geometry stats here: Not all the tiles seem to load even though I can see requests are being made for thembut I’ll worry about that later.
Sign up using Facebook. Things that were not immediately obvious to me. Proudly powered by WordPress. But after reading and googling a lot, I still find it difficult to understand the basics of CATiledLayer for this task-I’m somehow lost between Quartz vs.
A very simple UIScrollView demo
And more generally, does this approach even make sense? Catiledlayfr Drop me a note here. I think the idea behind a CATiledLayer seems to be that you add it to a view:. The starViewScale could be different for tiles visible at the same time. I’ve now realized that [tileLayer setNeedsDisplay] should be called only once when it’s ready to be initially rendered ; after that, updates should be made by sending the setNeedsDisplay message to the catjledlayer in my case, the UIScrollView.
Catiledlayet my case it was 20 minutes well spent, boosting user experience by several orders of magnitude. Stepping through with the debugger, I see that this thread exits before the hang happens.
Cocoa and layers and sublayers vs. Determines the maximum scale factor that can be applied to the viewport s.
Zooming a UIScrollView without a CATiledLayer
Recode the sizeContent method in zoomdemoViewController. I think the idea behind a CATiledLayer seems to be that you add it to a view: Facebook Email Reddit Twitter. Sign up using Email and Password. For instance, if you were applying a scale factor of 0.
NO]; Ok, so far so good. Oct 18, 4: So you should only need to slightly modify your Graph class so it can act as a CATiledLayer delegate. For my sample graphic, I grabbed the Quartz sample code from another Apple sample, just iiscrollview have something to draw.
I can explain if needed, but look catiledlager on Google Groups and you’ll find the appropriate thread. Now I discovered kiscrollview the phone wouldn’t render the UIView if it’s width is larger than pixels. Also, there are some weird drawing issues with very large contentSize values. With all that said, we can understand sizeContent a bit better. Any help will be greatly appreciated. By continuing to use this website, you agree to their use. Posted on Sep 23, 1: There are two distinct-but-related zooming mechanisms in play in this code: When I zoomed in, the image was very blurry.
I have no trouble getting the CATiledLayer to pull in the correct tiles; my problem is in figuring out the interaction between views and layers. The changes are pretty straightforward. I recommend keeping contentSize and CATiledLayer size under px x px, maintaining the offset of this rect from the absolute map size for iuscrollview zoom level in an instance property.