Re: Auto-layout: how do I make the other side "win"?
Re: Auto-layout: how do I make the other side "win"?
- Subject: Re: Auto-layout: how do I make the other side "win"?
- From: Quincey Morris <email@hidden>
- Date: Sat, 01 Apr 2017 14:00:04 -0700
On Apr 1, 2017, at 12:07 , Daryle Walker <email@hidden> wrote:
>
> I got a feeling that, since the interior of the window and the exterior of the view are probably bound, that the auto-layout system is choosing the view’s smaller size over the window’s bigger one. How do I reverse this? Or do I have to manually increase the size of all the interior views?
The window’s content rect *is* the frame of the content view, and you’re right that the window is initially resized to the content view size from the storyboard. In IB, you should set the content view size, not the window size, to the desired initial value. If you have a complete set of auto-layout constraints, that should be the only manual part of the adjustment, and all the subviews should resize correctly.
However, you have to be a bit careful. By defaults, windows are restorable. On the second and subsequent runs of your app, your window will restore to the last saved size, and the content will be resized to the window — the opposite of what happens on first run. You should disable restoration (in the Run scheme options) while you’re testing your initial window size. In addition, document windows are subject to resizing on opening, if you use a window autosave identifier.
_______________________________________________
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