title: Auto Layout in Navigation Controller with UISegmentedControl: good in iOS7, bad in iOS6
body: <p>For a navigation controller I like to have a few controls placed in a view from top towards the bottom. I am using auto layout and added constraints, so that the views have a vertical gap to each other. This looks nice for iOS7 and iOS6 in a normal view controller, also for iOS7 in a navigation controller; but wrong in iOS6. The UISegmentedControl shows up wrong. See the screenshots.</p>
  
  <p>It looks like the larger height of the UISegmentedControl is not taken into account for iOS6 view. Also it gets shifted out of place when switching from 3.5 inch to 4 inch screen.</p>
  
  <p>Note that this only occurs in a navigation controller view. In the storyboard for the navigation controller I set Top Bar to "Opaque Navigation Bar".
  The upper button has a constraint "Top Space to Top Layout Guide". All other controls have a constraint "Top Space to ...." (control above them).</p>
  
  <p>Are there any known fixes which I could apply?</p>
  
  <p>What could be wrong? (I'm quite a newbie for auto layout.) Or is it just a bug which I have to work around somehow?</p>
  
  <hr>
  
  <p>EDIT: </p>
  
  <p>I tried placing the segmented control in an extra view, but that did not help either. </p>
  
  <p>I could set a height constraint to the segmented control and that did help in a way. But this sets the same height to both iOS6 and iOS7 for the segmented control. My work around would now be to change/add the height constraint in code when the view loads and set a value depending on the iOS version. Are there other recommendations?</p>
  
  <hr>
  
  <p>The screenshots:</p>
  
  <p>In Navigation Controller, iOS6 view:</p>
  
  <p><img src="https://i.stack.imgur.com/9ppff.png" alt="Shifted Layout in iOS6-View"></p>
  
  <p>In Navigation Controller, iOS7 view:</p>
  
  <p><img src="https://i.stack.imgur.com/Oow5r.png" alt="Nice Layout in iOS7"></p>
  
  <hr>
  
  <p>In a "normal" view controller, iOS6 view:</p>
  
  <p><img src="https://i.stack.imgur.com/ifmje.png" alt="Nice Layout in iOS6-View"></p>
  
  <p>In a "normal" view controller, iOS7 view:</p>
  
  <p><img src="https://i.stack.imgur.com/MT71i.png" alt="Nice Layout in iOS7"></p>