On Aug 27, 2015, at 10:46 AM, Dave <d...@looktowindward.com> wrote: > >> On 27 Aug 2015, at 16:29, Ken Thomases <k...@codeweavers.com> wrote: >> >> You want the stack view to size itself to match the scroll view? Why? That >> would mean that the scroll view would never scroll, defeating the purpose of >> its existence. > > Sorry match the width, the width is fixed and the horizontal scroller is > disabled, I only want vertical scrolling.
For that you'll want to set up horizontal constraints between the stack view and the clip view, either directly if the stack view is the immediate subview of the clip view or indirectly if there's an interposing view. >> The document view of the scroll view should be the stack view itself. Your >> diagram above just shows a plain view. You _can_ do that, but then you have >> to manually add the stack view as that view's subview and add constraints to >> make their edges coincide. That's not hard, but is harder than necessary. > > Not sure what you mean, I have a ScrollView, I create the StackView in code, > add the one (for this test) DetailView to the StackView and then add the > StackView to the Scroll view. When I have multiple DetailViews, I will create > multiple VCs, add the Views to the StackView and then add the StackView > (containing all the detail views) to the Scroll view. When this happens I > want to to expand the details Views to fit the StackView and have it scroll > in Y if the number of DetailViews warrants it. Why aren't you creating the stack view in the NIB? Your NIB apparently has a scroll view containing a clip view containing a plain view. You're apparently planning to add the stack view as a subview of the plain view and set up constraints to have them match size and position. I don't see the need for the extra layer. You could have a scroll view containing a clip view containing a stack view. You can set that all up in the NIB. Then, at run time, all you have to do is add and remove subviews of the stack view. Regards, Ken _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com