title: Multiline UIButton and autolayout
body: <p>I have created a view controller that looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/IpFxP.png" alt="enter image description here"></p>
  
  <p>I want the two top buttons to always have 20 points between themselves and the left/right edges of the whole view. They should always have the same width too. I have created the constraints for all of this and it works exactly how I want it to. The problem is the vertical constraints. The buttons should always be 20 points beneath the top edge. They should have the same height. However, autolayout doesn't respect that the left label needs two lines to fit all its text, so the result looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/H7QKh.png" alt="enter image description here"></p>
  
  <p>I want it to look like in the first picture. I can't add constant height constraints to the buttons because when the app runs on iPad, only one line is needed and it would be wasteful to have extra space then.</p>
  
  <p>In <code>viewDidLoad</code> I tried this:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      self.leftButton.titleLabel.preferredMaxLayoutWidth = (self.view.frame.size.width - 20.0 * 3) / 2.0;
      self.rightButton.titleLabel.preferredMaxLayoutWidth = (self.view.frame.size.width - 20.0 * 3) / 2.0;
  }
  </code></pre>
  
  <p>But that did not change anyhting at all.</p>
  
  <p><strong>The question: How do I make autolayout respect that the left button needs two lines?</strong></p>