title: How can I use constraints AutoLayout with to specify a different layout on landscape vs. portrait without using code?
body: <p>I have an iPad app that features a login screen, with the login controls contained within a UIView. </p>
  
  <p>When the iPad is in portrait orientation I have the Login UIView near the bottom and center of the app, pretty much right above where the keyboard will be, and the company logo is in a UIImageView centered across the top. I'm using AutoLayout constraints to keep the company logo gravitated to the top and right, and the Login UIView gravitated to the bottom and right.</p>
  
  <p><a href="https://i.stack.imgur.com/JDYHZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JDYHZ.png" alt="enter image description here"></a><br>
  <sub>(source: <a href="http://chattypics.com/files/ipadportrait_0dzalz3ipx.png" rel="nofollow noreferrer">chattypics.com</a>)</sub>  </p>
  
  <p>When I rotate this to landscape, the effect is something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/JkvP3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JkvP3.png" alt="enter image description here"></a><br>
  <sub>(source: <a href="http://chattypics.com/files/ipadlandscape1_j15ps5c95u.png" rel="nofollow noreferrer">chattypics.com</a>)</sub>  </p>
  
  <p>I want it to look like this </p>
  
  <p><a href="https://i.stack.imgur.com/ZwBu4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZwBu4.png" alt="enter image description here"></a><br>
  <sub>(source: <a href="http://chattypics.com/files/ipadlandscape2_sobufqkdhg.png" rel="nofollow noreferrer">chattypics.com</a>)</sub>  </p>
  
  <p>So, I want the two elements to be side-by-side, and I want the Login UIView to be further to the right. The amount of spacing to the right of the UIView when in portrait mode is greater than I want for landscape mode, and the distance from the bottom is less than I want for Landscape mode. I could handle this via "center in container" instead, but that would also not work in Landscape mode.</p>
  
  <p>I've used the technique detailed <a href="https://stackoverflow.com/questions/16729302/two-views-one-below-another-in-portrait-and-side-by-side-in-landscape-using-lay">in this post</a> to make things be "side by side" when in landscape mode, but I don't believe it will suffice here because I want the layouts within the "views" to also be different on rotation. </p>
  
  <p>I can think of ways to pull this off programmatically, but I can't imagine this is all that unique a need, so is there some way using just constraints in IB to pull this off? Some "this is what constraints in IB were designed for" way, possibly dealing with priorities? Or do I just need to pull this off in code?</p>