User Tools

Site Tools


ios-labs-s14:advanced-autolayout

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ios-labs-s14:advanced-autolayout [2014/02/23 23:06] (current)
mbarboi created
Line 1: Line 1:
 +=====Autolayout=====
 +An advanced system of organizing views on controllers. Useful for designing views that display correctly for multiple device sizes.
  
 +Relies on **constraints** which force objects'​ properties (x, y, width, height, etc) into certain ranges. Constraints can tie any of the given properties to another object, allowing a developer to make relative layouts instead of fixed ones. 
 +
 +Examples of constraint usage:
 +  -place UILabel'​s left border at the right edge of this UIImage
 +  -put UIButton less than 100 pixels below UILabel, but more than 20
 +  -lock the height of UIImage to half its superview
 +
 +Autolayout becomes painful when dozens of constraints jostle in a view. Autolayout attempts to place items by solving all the constraints in an equation; bugs are not immediately apparent.
 +
 +Use when needed, avoid if possible: steep learning curve.
ios-labs-s14/advanced-autolayout.txt ยท Last modified: 2014/02/23 23:06 by mbarboi