Re: moving subviews
Re: moving subviews
- Subject: Re: moving subviews
- From: Quincey Morris <email@hidden>
- Date: Tue, 12 Aug 2008 09:52:44 -0700
On Aug 12, 2008, at 00:49, Georg Seifert wrote:
I have a big document view. On it I place some small subviews. I f I
scroll the document view, the subviews should move with it but only
till it reaches the edge of the visible area of the main view.
e.g: if i move the main view down, and the subview hits the
scrollbar, it should stick there.
is there a sane way of achieving this or do I better lock for an
other behavior?
It's fairly easy to do. Register to receive bounds-changed
notifications from your document view's clip view -- what the
documentation calls the scroll view's content view, actually the
parent view of your document view -- and also tell the clip view to
post these notifications, since it doesn't do that by default.
When you receive the notification, you can use the document view's
visibleRect (which is the clip view bounds, but in the document view's
bounds coordinate system) to work out whether and where to move the
subview.
_______________________________________________
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