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 (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

Reply via email to