Re: Scroll/Position Image in Scrollview that is smaller than the Scrollview
Re: Scroll/Position Image in Scrollview that is smaller than the Scrollview
- Subject: Re: Scroll/Position Image in Scrollview that is smaller than the Scrollview
- From: Matt Neuburg <email@hidden>
- Date: Fri, 26 Nov 2010 08:46:20 -0800
On Wed, 24 Nov 2010 12:04:26 +0100, email@hidden (Hado Hein) said:
>But when the picture is zoomed to a size smaller than the ScrollView the
>picture is placed in the top left corner and no more scrolling happens.
>In simple I want to center the small ImageView in the bigger ScrollView
>so that there is still scrolling possible.
Scrolling is possible if the contentSize is larger than the scroll view. If the image view is the scalable view (for zooming purposes), then if it is zoomed smaller than the scroll view, no scrolling is possible. I think you're going to want to embed the image view in a superview, make the superview the scalable view, and adjust the size and position of the image view within that superview yourself. It is possible also to trick the scroll view by removing the transform of the scalable view, but in that case you break the scroll view's idea of how zoomed the content is, so you have to give it new maximum-minimum zoom values to compensate and track the "real" zoom value yourself. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings_______________________________________________
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