title: Where is this vertical spacing coming from in UILabelView?
body: <p>I'm creating an iOS view that displays various static text elements. The xib looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Z1tuW.png" alt="enter image description here"></p>
  
  <p>It uses four labels for the title, timestamp, body, and footer. Every view is anchored to the sibling view above it vertically and anchored to the left/right of the parent view. All labels have a fixed height except the body which has a >= height and the number of lines set to 0 with "word wrap" as the line wrapping style. The parent view is a UIScrollView.</p>
  
  <p>On the iPhone it looks like fine:</p>
  
  <p><img src="https://i.stack.imgur.com/88S6n.png" alt="iPhone beginning of scroll">
  <img src="https://i.stack.imgur.com/oIuc1.png" alt="iPhone end of scroll"></p>
  
  <p>However on the iPad it looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/sqetj.png" alt="iPad beginning of scroll">
  <img src="https://i.stack.imgur.com/zidmO.png" alt="iPad end of scroll"></p>
  
  <p>Huh? Where is all that extra vertical space in the body label coming from? The xib and its view controller are identical between iPhone and iPad (there is no custom iPad code at the moment). I've found that the vertical space is directly related to how many line-wraps the label renders. If no lines wrap, no extra vertical space. If only a few lines wrap, there's a little extra vertical space. If nearly every line wraps, well, that's what it looks like.</p>
  
  <p>First of all any ideas on why UILabel is behaving this way?</p>
  
  <p>Second of all, if I can't make it stop doing this how can I work around it?</p>
  
  <p>I've already tried a few things. If I call [bodyLabel sizeToFit] within -viewDidLayoutSubViews then it fixes the label but doesn't fix the layout of any of the sibling views (e.g. the Footer label is stuck way at the bottom of the screen instead of pulled up to just under the body). Any attempts to get the entire view to re-layout its children after calling sizeToFit is ignored. I've also tried sizing the UILabel by calculating height based on font, which results in the same behavior as -sizeToFit (albeit with more code).</p>
  
  <p>Replacing the Body UILabel with a UITextView instead doesn't give me the weird vertical spacing issues but I need to calculate the height of the UITextView manually (using font calculations) and something about resizing the UITextView within the parent UIScrollView makes it so the UIScrollView simply refuses to scroll (as if it doesn't know its contents are too big for its bounds).</p>
  
  <p>So at the moment I'm stuck. Even just an explanation of <em>why</em> UILabel behaves this way on the iPad layout would be helpful.</p>