4

The top and bottom text label for my tableView cell appears to be cutting off. It is not clipped in the Xcode preview or the storyboard view. How do I make the labels extend to fill the entire row?

I am using a stack view that contains the file name and file size labels.

iPhone 7 Plus Example

Nate23VT
  • 423
  • 8
  • 27

3 Answers3

5

There are a couple of "potential solutions":

  1. set your constraints (especially the height constraint of the label) correctly

  2. set your cell height correctly. (You probably want to use automatic height)

The layout would be broken if you didn't match these 2 conditions.

This thread will be helpful: https://stackoverflow.com/a/18746930/938380

Community
  • 1
  • 1
Brian
  • 30,156
  • 15
  • 86
  • 87
  • I thought I had set the label constraint but apparently that was the issue. I also had a constraint on the image that I don't think was necessary. Thanks! – Nate23VT Feb 01 '17 at 15:48
  • you saved me so much time.. thank you! :) I forgot to add a contraint from the last element to the bottom of the superview.. – Sean Stayns Mar 16 '19 at 01:27
1

Maybe you just forgot to set tableView.estimatedRowHeight = ...

Lachtan
  • 4,803
  • 6
  • 28
  • 34
-1

Increase the height of label then it will look what you are expected size of the Label.

Preetha
  • 753
  • 9
  • 12