简体   繁体   中英

Label cut off on Table View Cell

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 示例

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

也许你只是忘记设置tableView.estimatedRowHeight = ...

增加标签的高度,然后它会看起来像你期望的标签大小。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM