• 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: Newbie scroll view problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie scroll view problem


  • Subject: Re: Newbie scroll view problem
  • From: Graham Cox <email@hidden>
  • Date: Fri, 19 Dec 2008 11:24:13 +1100


On 19 Dec 2008, at 10:57 am, Andy Bettis wrote:

In my app I have an NSScrollView that contains a simple NSView in which I add other NSView subclass objects. All works well until the window (and hence the scroller) is resized - making it smaller is OK but if it is made bigger than the original (IB) size my added views migrate down the window. I've tried adjusting the autosizing settings but to no avail.

I'm trying not to have to subclass the containing view, I just want the scroller to reveal more of it as it is enlarged while leaving my subviews aligned to the top left corner. Do I need to flip the coordinates to keep them up there? I'll probably end up limiting the maximum window size so the user can't make it too big but I'd like to know what's going on.


One thing I've noticed in this sort of situation is that the "simple view" will typically need to be flipped, which requires subclassing, just for that one setting. Otherwise the scroller that contains it starts off scrolled to the bottom, which is not usually what you want.

Also, remember that the subviews are positioned relative to the bounds of the "simple view", which presumably is of some fixed size which is why you want to scroll it. If this view isn't flipped everything will be positioned relative to the bottom left corner. That should be OK, but given the behaviour of NSScrollView when it contains a non-flipped view, I think that's why you're seeing the views move around.

Just try flipping the "simple view".

hth,

Graham


_______________________________________________

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: 
 >Newbie scroll view problem (From: Andy Bettis <email@hidden>)

  • Prev by Date: Re: NSTableView cross-coupling rows when editing strings?
  • Next by Date: Re: CLLocationDistance contents?
  • Previous by thread: Newbie scroll view problem
  • Next by thread: NSData downloaded over socket is bigger than it should be...
  • Index(es):
    • Date
    • Thread