title: OS X Cocoa Auto Layout hidden elements
body: <p>I am trying to use the new <a href="http://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AutolayoutPG/Articles/Introduction.html" rel="noreferrer">Auto Layout</a> in Lion because it seems quite nice. But I can not find good information about how to do things. For example:</p>
  
  <p>I have two labels:</p>
  
  <pre><code>+----------------+
  | +------------+ |
  | + label 1    | |
  | +------------+ |
  |                |
  | +------------+ |
  | | label 2    | |
  | +------------+ |
  +----------------+
  </code></pre>
  
  <p>but the first label gets not always populated with content, sometimes there ist just no content for it. What I would like to do is to automatically show the label 2 where label 1 would be when it would have content.</p>
  
  <pre><code>+----------------+
  | +------------+ |
  | + label 2    | |
  | +------------+ |
  |                |
  |                |
  |                |
  |                |
  +----------------+
  </code></pre>
  
  <p>What constrains would I have to add so it works automatically with autolayout? I understand that I could just code everything, but I have about 30 such labels and images and buttons of different styles and shapes which are all optional and I don't want to add hundrets of lines of code when it could work automatically quite nice too.</p>
  
  <p>If it does not work then I will just use a WebView and do it with HTML and CSS.</p>