0

As I said, I have two subviews that I want to fit their superview, 50% width each. But I don't want their heights to change. I know how to use apsect ratio for changing height and width - how can I adapt this for only width?

Tony Friz
  • 883
  • 1
  • 10
  • 27
  • I believe http://stackoverflow.com/questions/14935825/autolayout-make-height-of-view-relative-to-half-superview-height answers your question :) Sometimes I find it easy to create two views, side by side - each 50% width, and just set them to have equal widths. Align the left view on the left to the superview and the right view on the right to the superview. Also add the height constraint to set the specific height. – Josh Gafni Mar 18 '15 at 00:38
  • Great! Just added it as an answer. Could you accept it? – Josh Gafni Mar 18 '15 at 00:55

1 Answers1

1

I believe this answers your question :)

Sometimes I find it easy to create two views, side by side - each 50% width, and just set them to have equal widths. Align the left view on the left to the superview and the right view on the right to the superview. Also add the height constraint to set the specific height.

Community
  • 1
  • 1
Josh Gafni
  • 2,831
  • 2
  • 19
  • 32