Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS7 auto layout, constraints, compression, content hugging
    primarykey
    data
    text
    <p>I’m having bit of a tough time getting my head around auto layout, constraints, priorities, compression and content hugging. I think I understand it but getting it to play nicely seems to be impossible.</p> <p>I have this simple view, with 3 buttons and a label. I want them to be able to adjust to fit the screen when the user orients the screen.</p> <p>All the buttons are pinned to the leading and trailing superview. The top label’s top is pinned to the super view. The bottom button’s bottom is pinned to the superview.</p> <p>There are vertical space constraints between the buttons. I have tried varying priority levels for the compression of the buttons to get them to squeeze vertically for the horizontal view, but everything disappears off the screen. Or one of the lower buttons appears above the upper buttons.</p> <p>I am sure I am doing something quite simple to make these errors. </p> <p>Would someone be able to offer me their 2 cents on how to fix this?</p> <p>Many thanks for any help!</p> <p>Merry xmas!</p> <p>Adam</p> <p><img src="https://i.stack.imgur.com/u3xw4.jpg" alt="vertical"></p> <p><img src="https://i.stack.imgur.com/kXtSy.jpg" alt="horizontal"> <img src="https://i.stack.imgur.com/zRyib.jpg" alt="enter image description here"></p> <p><strong>UPDATE - after "update all frames"</strong> It seems button 01 disappears when the view is rotated <img src="https://i.stack.imgur.com/0oe7m.jpg" alt="enter image description here"></p> <p>**UPDATE #02 - almost working but not sure how ** Guys I seem to have managed to get it to work, but i'm not really sure how. And it's not reliable - if I adjust the constraints between the label and the first button then the oriented view ends up scaling off out of the bounds of the screen. I would assume that I could adjust that vertical constraint to be able to change that space, but it just makes a mess. <img src="https://i.stack.imgur.com/HiRvX.jpg" alt="enter image description here"> <img src="https://i.stack.imgur.com/RspfC.jpg" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload