If you specify autoresizing masks instead of constraints, or specify no constraints at all, then the view will have NSAutoResizingMaskLayoutConstraint constraints as opposed to NSLayoutConstraints. If you set translatesAutoresizingMaskIntoConstraints
to NO
, then these constraints do not appear. You can’t mix and match on a single view, or you get unsatisfiable constraint errors.
I set up a quick test project with various combinations of autoresizing masks and the logging format is pretty straightforward.
h=
orv=
indicates that we are talking about contraints in the horizontal or vertical direction.-
indicates a fixed size&
indicates a flexible size- The order of symbols represents margin, dimension, margin
Therefore, h=&-&
means you have flexible left and right margins and a fixed width, v=-&-
means fixed top and bottom margins and flexible height, and so forth.