1

Hi I am trying to get 4 rectangles to be each 1/4 of the screen size for each IPhone size from 4 to 6.

I have tried adding constraints and setting the rectangles to equal height but still haven't succeeded.

Is there an easy way to set to set this?

Thank you

  • a very good tuto to do that : http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2 :) – HamzaGhazouani Feb 05 '15 at 10:51
  • Get the screen/window size then divide it by /4 http://stackoverflow.com/questions/24110762/swift-determine-ios-screen-size – JSA986 Feb 05 '15 at 10:51

1 Answers1

5

You have to add the equal heights constraint to every rectangle (from the rectangle to the view, which has the exact height of the screen), and then click on the constraint, and set the multiplier to 1:4.

enter image description here

enter image description here

Dániel Nagy
  • 11,815
  • 9
  • 50
  • 58