January 13, 2020   |   by admin

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: Takasa Gakora
Country: Turkmenistan
Language: English (Spanish)
Genre: Automotive
Published (Last): 19 September 2007
Pages: 199
PDF File Size: 10.16 Mb
ePub File Size: 5.37 Mb
ISBN: 672-3-22699-404-5
Downloads: 9690
Price: Free* [*Free Regsitration Required]
Uploader: Dojora

And, just to keep things clear, you should probably uiscrollvifw the comment at the top of this method, as well:. This arrangement will tend to produce a higher-quality, more efficient image than would be obtained by simply applying a raw scaling transform to the full-resolution tiles.

Second, I need to trigger a redraw of the image when the zoom level changes.

I’ve read through Apple’s docs, but they don’t seem catiledlayyer explain the behavior I’m seeing: Mac OS X The zoom limits are fixed, but should cailedlayer dynamic.

To start the conversation again, simply ask a new question. Stepping through with the debugger, I see that this thread exits before the hang happens. Ideally I would like to keep the Graph class untouched, just draw the context entirely, split it into tiles and scroll those.


A very simple UIScrollView demo – Hal Mueller’s Blog

Post as a guest Name. So I’m building my own native iPhone map. It was being drawn at the same pixel resolution used when zoomed out: I can get a map to show up geographically located where I expected it to be.

Any help will be greatly appreciated. Also, there are some weird drawing issues with very large catileldayer values.

Zooming a UIScrollView without a CATiledLayer

You can run the demo, and see the zooming goodness. The big change to TiledView has to do with tile index calculation.

Aside from being slightly confusing, this makes the process of resizing the world — which might make sense for certain applications — potentially more complex. So you should only need to slightly modify your Graph class so it can act as a CATiledLayer delegate. Reply Helpful Thread reply – more uiscrolpview Link to this Post. Perhaps someone could give me an outline, just some bulletpoints or pseudocode, how I should restructure the scrollview, uiview and the graph class to use tiling.

Sorry, uicsrollview blog cannot share posts by email. All replies Drop Down menu. My content view has a scaled of 0. Finally, performance — at least in the iPhone4 simulator — is a little scary. If so, how should I continue?


A very simple UIScrollView demo

I’ve logged my screen geometry stats here: The starViewScale could be different for tiles visible cailedlayer the same time. Not all the tiles seem to load even though I can see requests are being made for thembut I’ll worry about that later.

For my sample graphic, I grabbed the Quartz sample code from another Apple sample, just to have something to draw. And more generally, does this approach even make sense? Sign up using Facebook. Proudly powered by WordPress.

CATiledLayer in a UIScrollView (for nativ… – Apple Community

Note that that code is still not great. It was being drawn at the same pixel resolution used when zoomed out:. To return to a point mentioned above: The big problem right now is that the simulator freezes up on subsequent calls to setCenter: I think the idea behind a CATiledLayer seems to be that you add it to a view:.

What might cause this? This site uses cookies. I think the idea behind a CATiledLayer seems to be that you add it to a view: