Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,558
6,058
Hi guys, I thought I'd share this for anyone else who despises the new Constraints Auto-Layout system:

To turn it off, go into your interface file, choose the document tab (the leftmost one in the tab bar on the right panel.) and uncheck the box "Use Auto Layout"

And bam, just like that, it tosses out the hundreds of complicated constraints (which do anything but "just work" like Apple's docs say they do,) and takes you back to the actually auto-magical system of struts and springs.

I can't say how many times I've been working on an Android app in Eclipse and just wished they had a layout system anywhere near as simple as struts and springs. I was dumbfounded when I saw Apple had actually duplicated the freaking nightmare that is Android UI design (okay, maybe not quite duplicated... they don't force you to pick from a dozen layouts like Android.)

Oh, and as a further nail in the coffin for Constraints and Auto-Layout, it means that Snow Leopard users can't use your app. (As much as I like Lion/ML, I still hear that tons of my customers use SL, so I consider it essential that I continue to support it.)
 

Senor Cuete

macrumors 6502
Nov 9, 2011
421
30
Good Tip

I couldn't get an auxiliary panel to look right in an NSSavePanel. A popoup menu was clipped. It turned out that Auto Layout was the problem and it took me a long time to figure it out.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
Hi guys, I thought I'd share this for anyone else who despises the new Constraints Auto-Layout system:

To turn it off, go into your interface file, choose the document tab (the leftmost one in the tab bar on the right panel.) and uncheck the box "Use Auto Layout"

And bam, just like that, it tosses out the hundreds of complicated constraints (which do anything but "just work" like Apple's docs say they do,) and takes you back to the actually auto-magical system of struts and springs.

Ahem... struts and springs work "auto-magically" up to some degree, and then it breaks down. There are plenty of things that you just can't do. And good luck if you have views where the width or height can be changed to zero.
 

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,558
6,058
I'm going to now mock myself of yesteryear by beginning this post the same way I started the original one:

Hi guys, I thought I'd share this for anyone who despises the Constraints Auto-Layout system:

First off, a comic explaining how you feel:

Constraints-perfect.png


Next, a tutorial that should help you understand why the new system is helpful and how to use it:

http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

But now, I think I'd like to mention one thing that Struts and Springs easily has on Constraints which might lead to Constraints becoming less despised by people transitioning:

Struts and Springs clearly showed which ones were turned on (as Constraints do) AND also showed what potential additions could be made. Making those additions were as easy as clicking on them. I think Constraints should be always visible directly in the interface to be easily turned on.

And I suppose I'll share an anecdote of this sudden turnabout from a Constraint hater to lover:

I was Googling about an hour ago "What is the longest international weekday title?" I have a label that needs to hold a weekday name but no more. I know that Wednesday will take up the most space in English, but who knows what crazy weekday names German, for example, has (as it turns out, it looks like Icelandic might actually have the longest names for weekdays... or possibly Indian...)

Then I realized the absurdity of what I was looking for, thought, "there has to be a better way", and then I realized the better way had to be within abandoning struts and springs and going to constraints. The tutorial I posted actually mentions that constraints solve exactly this kind of problem.
 
Last edited:

Qaanol

macrumors 6502a
Jun 21, 2010
571
11
Thanks AoW, good job finding this setting.

I have an Xcode project set to build for a 10.6 target, but for some reason it decided to use Autolayout, which of course doesn’t work on 10.6.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.