NSScrollView: should I use autolayout or not?
NSScrollView: should I use autolayout or not?
- Subject: NSScrollView: should I use autolayout or not?
- From: Chuck Soper <email@hidden>
- Date: Tue, 19 Feb 2013 18:30:42 -0800
- Thread-topic: NSScrollView: should I use autolayout or not?
I want to use NSScrollView to create a row of custom views. The width of
each custom view can be resized by the user, very similar to an
NSTableView (resizable columns within an NSScrollView). The height of each
custom view would be pinned to the documentView (which would be pinned to
the NSScrollView). I also need to be able to drag and drop custom views
for reordering within the NSScrollView or to another NSScrollView (ideally
opening up a gap between two views in the destination before the drop).
The main question I have is whether I should even try to use autolayout to
place and resize the custom views within the NSScrollView? Not using
autolayout, and simply adjusting the frames for each custom view seems
easier. This approach will still allow me to use autolayout within the
custom views and within the main view for the window. In general, I think
that autolayout is very useful.
Does anyone recommend using autolayout to place and resize custom views
within an NSScrollView? If so, how do you auto adjust the width of the
documentView (of the NSScrollView)? Previously, I found that I had to call
setFrame: on the documentView, but I believe that setFrame: is never
supposed to be used when using autolayout.
And, I'm curious if anyone recommends avoiding the use of autolayout when
placing and resizing items within an NSScrollView. Right now, I'm leaning
towards not using autolayout within this scroll view unless there's some
compelling reason to do so.
Thanks,
Chuck
_______________________________________________
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