• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: moving subviews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >moving subviews (From: Georg Seifert <email@hidden>)

  • Prev by Date: Re: Should I retain a variable returned from this accessor?
  • Next by Date: Re: Disc write speed options
  • Previous by thread: Re: moving subviews
  • Next by thread: Create a calendar group using CalendarStore framework
  • Index(es):
    • Date
    • Thread