title: How to resize a parent view based on the size of subviews layouted with Autolayout
body: <p>I am preparing a custom view which looks similar to the example shown in the screenshot. I add all user interface components (labels, text fields, radio buttons, ..) at runtime. To position the elements I use <a href="http://developer.apple.com/library/mac/#releasenotes/UserExperience/RNAutomaticLayout/_index.html#//apple_ref/doc/uid/TP40010631" rel="noreferrer">Autolayout</a> constraints. This part works fine so far.</p>
  
  <p><img src="https://i.stack.imgur.com/irIgg.png" alt="Custom View"></p>
  
  <p>The number of elements varies from context to context. I wonder how I could use Autolayout constraints to <strong>dynamically resize the parent view</strong> (most likely the height of the view). The view constraints therefore should consider the height and margins defined for the currently attached subviews.</p>