Re: Still can't get autolayout to work the way I want
Re: Still can't get autolayout to work the way I want
- Subject: Re: Still can't get autolayout to work the way I want
- From: Kyle Sluder <email@hidden>
- Date: Thu, 19 Sep 2013 17:29:14 -0700
On Sep 19, 2013, at 4:23 PM, Brad O'Hearne <email@hidden> wrote:
>
> Anyway, you get the point. I have found myself actually devoting time to trying to reverse-think how some of these auto-generated constraints appear, because some of them are so wacky I find myself wondering that it must be something ridiculously simple I'm missing.
All of this is so vastly improved in Xcode 5 that I honestly can't compare them.
Xcode 5 doesn't insert any constraints for you at design time. You are free to drop anything you want wherever you want on the canvas, and no blue tentacles will emerge from your views.
When Xcode compiles your nib, any views without constraints attached to them will get fixed top, left, width, and constraints that reflect their position in the canvas. This means you can test our your interfaces while getting reasonable, if not ultimately desired, autoresizing behavior.
Once you add a constraint to a view, IB now starts providing hints as to what other constraints you need to add to correctly define that view's size and position. But it never forces those constraints on you. Even if you install a consistent and unambiguous set of constraints on a view, you can then drag that view willy-nilly around its container. IB will warn you that what you get at runtime will look wildly different from where the views are right now, and it will let you quickly snap the views back to their runtime frames (which are represented by a dotted outline).
IB also has support for marking individual constraints as "placeholders", meaning they are removed at compile time. This lets you design your interface with constraints that mimic ones which will get installed at runtime. You can also provide a placeholder intrinsic content size, which is very useful for placing custom controls.
--Kyle Sluder
_______________________________________________
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