Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mikhail The problem with springs and struts Traditional solutions Hard-coded layout 2+ nibs Auto layout What about iPhone 5?

Similar presentations


Presentation on theme: "Mikhail The problem with springs and struts Traditional solutions Hard-coded layout 2+ nibs Auto layout What about iPhone 5?"— Presentation transcript:

1 Mikhail Merkulov @mikhailmerkulov

2 The problem with springs and struts Traditional solutions Hard-coded layout 2+ nibs Auto layout What about iPhone 5?

3 Constraint-based layout Frames are determined automatically attribute1 == multipler × attribute2 + constant Button.left = superview.left + 10 New class: NSLayoutConstraint Immutable except Constant property Demo

4 Low level API The visual format language Demo

5 The constraints must be sufficient Ambiguous layout The constrains must not conflict Unsatisfiable constraints Unexpected ways Demo

6 Partial and full conversion? Convert nibs Review programmatically created views Replace setFrame, etc. Rethink your layout (Divide responsibility between controllers and views) Add constraints updateConstraints and intrinsicContentSize

7 Cocoa Auto Layout Guide Session 202: Introduction to Auto Layout for iOS and OS X Session 228: Best Practices for Mastering Auto Layout Session 232: Auto Layout by Example Beginning Auto Layout in iOS 6

8


Download ppt "Mikhail The problem with springs and struts Traditional solutions Hard-coded layout 2+ nibs Auto layout What about iPhone 5?"

Similar presentations


Ads by Google