Auto Layout in iOS 6 Beta

2019-02-15 23:36发布

问题:

Auto Layout was announced in iOS 6 but I've been having difficulty finding any information or documentation about it. How exactly is it used? Does it use NSLayoutConstraint? Are there any resources available?

回答1:

If Auto Layout in iOS 6 turns out to be anything like Cocoa Auto Layout in Mac OSX 10.7, the Cocoa Auto Layout Guide, a publicly available document, may give you an idea of how it would work in Cocoa Touch.

The underlying engine used by Cocoa Touch is Cassowary, and it's also used in other toolkits, such as enaml. I recently wrote a brief overview of Cassowary, with a comparison between Cocoa Touch and enaml wherein I port a Cocoa Auto Layout example to Python and enaml.