title: Make UIView and contents expand to fill available horizontal space in UIToolbar with Auto Layout
body: <p>I have a <code>UIBarButtonItem</code> and a <code>UIView</code> containing two <code>UITextField</code> controls, all within a <code>UIToolbar</code>.</p>
  
  <p>This is a screenshot of my storyboard: <a href="http://i.8px.co/x8eC.png" rel="nofollow">http://i.8px.co/x8eC.png</a>. </p>
  
  <p>I'd like to create something similar to this: <a href="http://i.8px.co/1hvY.png" rel="nofollow">http://i.8px.co/1hvY.png</a>.</p>
  
  <p>I'm trying to make the <code>UIView</code> and its children expand to fill the available horizontal space in the <code>UIToolbar</code> with <strong>Auto Layout</strong>. I don't know how to accomplish what I want.</p>
  
  <p>I experimented with a dirty solution for the UIView and was able to have it size somewhat correctly.</p>
  
  <pre><code>view.width = toolBar.frame.width - button.width 
  // where view is the UIView, toolBar is the UIToolBar, and button is the UIBarButtonItem
  </code></pre>
  
  <p>I don't believe this is very elegant. This is done programmatically, the <code>UIView</code> doesn't conform to the standard <code>UIToolbar</code> margins, and the solution doesn't apply to the <code>UITextFields</code>.</p>