Re: Auto Layout Problems
Re: Auto Layout Problems
- Subject: Re: Auto Layout Problems
- From: Luther Baker <email@hidden>
- Date: Fri, 04 Sep 2015 14:39:07 -0500
I may not be following the entire thread very well - but as you likely
know, with autolayout, the scrollview's content size is literally
determined by its contents. It is generally simple to bind the scrollview
edges to the parent you mention but I think your next step is to properly
size the Stack View ... (child view) so that the ScrollView knows how big
to make it's content view.
On iOS, I can set width and height constraints between the child view and
its parent ScrollView's frame ... telling the child view to be the same
width and height as the ScrollView's frame. Note that these constraints are
not associated with the ScrollView's content view. Indeed, they drive the
content view's size. Think of it as the content view "reaching back" and
finding out how big it should be by constraining to sizes up the hierarchy.
I assume that model ports over to MacOS ... but I could be wrong.
Also, I'm guessing this bulletin was presented earlier but if not
https://developer.apple.com/library/ios/technotes/tn2154/_index.html
HTH,
-Luther
On Fri, Sep 4, 2015 at 12:48 PM, Dave <email@hidden> wrote:
> Hi,
>
> > It seems your thread keeps changing subjects so it's been difficult to
> follow your troubles back to something at the start, or maybe something's
> gotten lost.
>
>
> What I’d dearly love to know right now is how to setup the Constraints for
> a Scroll View and Clip View etc. in XCode/IB for Mac.
>
> If I have a window in a NIB like this:
>
> Window Initially
> - Width=846, Height=594
> View
> ScrollView Initially
> - X=20,Y=20, Width=806, Height=554
> Flipped Clip View
> View
>
> How do I set the constraints for the above Views in XCode/IB?
>
> I want the Scroll View to Stretch/Contract if the window is resized.
>
> After this, I’d like to add a StackView to the Scroll View (in XCode/IB)
> and have it Match the Size/Position of the Scroll View.
>
> I’ve found (sketchy) articles describing how to it in XCode/IB for iOS and
> I’’ve found (again sketchy) an article how to do it in Code for Mac.
>
> Ideally I’d like to be able to do this and target 10.9 and using XCode 6.4.
>
> All the Best
> Dave
>
>
> _______________________________________________
>
> 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
>
_______________________________________________
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