>> 1) I could just create an UIImageView and just move the origin into the >> negative. The clipping happens naturally through the parent view. > > This is basically re-inventing the wheel, except that users won't fully > understand what your re-invention has to offer.
I would not go so far to call this an "invention" so it cannot really be a re-invention ;) Just trying to understand the details here. So if one does not care about zooming and all other things UIScrollView helps with... this is not a terribly wrong thing to do? It's just that there is something in UIKit that does this, too? After all -in a very simple setup, think user interaction disabled- changing the frame of a subview vs changing the content offset of UIScrollView is not that much different. I am just wondering what's going on "under the hood" and if the UIScrollView has just some more tricks why it should be use instead. >> 2) I could use a UIScrollView and add the large UIImageView to it and move >> the content offset > > Least code, works as users expect, almost certainly the best solution :). It is implemented like that - but I still want to know :) >> 3) I could have a custom view that basically just draws a portion of the >> image. Something along the lines of > > This is SLOW. UIKit uses Core Animation to back its views, and Core Animation > caches content for speedy redraw in hardware. By re-drawing your image you > are defeating all of these optimizations. Even if you have really large > content, it would be better to use multiple image views rather than drawing > the subsection you need manually. Ah. Interesting. Didn't think of it like that. Thanks! -- Torsten _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com